Laravel

From Adam Colton
Revision as of 22:30, 21 January 2016 by Adamcolton (talk | contribs)
Jump to navigation Jump to search

Implicit Route Binding

From this video

 Route::get('users/{user}', function(App\User $user){
   return $user;
 });

If the arg name matches the token, it will magic that value into place. With the type hinting, it will find a user with the primary key given in the url.

To use something other than the primary key, you have to add a route binding in RouteServiceProvider.

Auth

Video

 php artisan make:auth

Creates a bunch of views, routes and adds a controller.

Email

Easiest is to use 'sendmail'. Make sure to set 'from' in config/mail.php.

Homestead

I'll need to try setting up a homestead instance on AWS with Vagrant. Could be useful to know for other projects too.

Illuminate/html

Has form builder - interesting...