Show Menu
Cheatography

Laravel 5.5 Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Artisan

php artisan make:model -m ModelName
php artisan make:c­ont­roller Foobar­Con­troller
php artisan make:test SomeFe­atu­reTest
php artisan make:test --unit SomeUn­itTest

Paginate result

{
  "current_page": 1,
  "data": [],
  "first_page_url": "http://foo.bar/model?page=1",
  "from": 1,
  "last_page": 5,
  "last_page_url": "http://foo.bar/model?page=5",
  "next_page_url": "http://foo.bar/model?page=2",
  "path": "http://foo.bar/model",
  "per_page": 25,
  "prev_page_url": null,
  "to": 25,
  "total": 111
}
 

Update and reload composer

//ensure you have the lastest version of composer
composer self-u­pdate
//regen your class maps
composer dump-a­utoload
// Remove compiled services & packages
php artisan clear-­com­piled