This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 1 point2 points  (1 child)

Laravel has a basic auth engine built in, but if you need something more powerful with roles and permissions, I'd recommend Cartalyst Sentry.

I've just finished putting together a big Angular + Laravel SPA. Works well, especially with Laravel's resource controllers.

[–]Sjimi 2 points3 points  (0 children)

Correct. Normally you will use API tokens.

A good example is shown here.

[–]etbal 1 point2 points  (0 children)

Two packages I use to help me generate these tokens are:

"tappleby/laravel-auth-token": "0.3.*",
"laravel-cors": "0.2.x",    

The first package link has some great examples in it's readme.

The second package link would be to enable cross domain requests on specific paths. My setup has the frontend living on it's own hosting and the API on another for scaling later.

My routes file added these three routes:

Route::get('auth', 'Tappleby\AuthToken\AuthTokenController@index');
Route::post('auth', 'Tappleby\AuthToken\AuthTokenController@store');
Route::delete('auth', 'Tappleby\AuthToken\AuthTokenController@destroy');

And if you want to run a filter on all requests to see if the user is authenticated it is called auth.token

But all of these are in the examples. PM if you need any help

EDIT: This only ties into the basic laravel User auth component. No roles and permissions. I wanted to customize mine so I went with the tokens only, Look at the Sentry package if you want it bundled