Skip to content

Commit

Permalink
add auth to api with passport
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniyal-Javani committed May 4, 2019
1 parent 47d8d61 commit 7bde348
Show file tree
Hide file tree
Showing 6 changed files with 995 additions and 80 deletions.
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Expand Up @@ -35,6 +35,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
],

'api' => [
Expand Down
3 changes: 2 additions & 1 deletion app/User.php
Expand Up @@ -4,10 +4,11 @@

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use \Laravel\Passport\HasApiTokens;

class User extends Authenticatable
{
use Notifiable;
use Notifiable, HasApiTokens;

/**
* The attributes that are mass assignable.
Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -8,6 +8,7 @@
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.6.*",
"laravel/passport": "^7.2",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.5"
},
Expand Down

0 comments on commit 7bde348

Please sign in to comment.