File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ Once this is done, you will need to make a few additions to your user model like
50
50
51
51
Add the following code to your User model inside your app directory
52
52
53
+ ``` php
53
54
use Notifiable, PresentableTrait, HasRoles, HasApiTokens;
54
55
55
56
protected $presenter = UserPresenter::class;
@@ -61,31 +62,38 @@ Add the following code to your User model inside your app directory
61
62
public function profile()
62
63
{
63
64
return $this->hasOne('Inferno\Foundation\Models\Profile');
64
- }
65
+ }
65
66
66
67
public function token()
67
68
{
68
69
return $this->hasMany('Inferno\Foundation\Models\\Token');
69
70
}
71
+ ```
70
72
71
73
And make sure you have an additional $fillable property 'active' which we are
72
74
using to detect whether the user is active or not.
73
75
74
76
You need to also add:
75
77
78
+ ``` php
76
79
Passport::routes();
80
+ ```
77
81
78
82
to the AuthServiceProvider as per the Passport installation process and you need
79
83
to add the middleware to web section of the middleware groups so that the
80
84
ApiToken is created for each request to any api route as per Passport installation.
81
85
86
+ ``` php
82
87
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
88
+ ```
83
89
84
90
And then, we need to run two commands:
85
91
92
+ ``` php
86
93
php artisan migrate
87
94
php artisan passport:install
88
95
php artisan inferno:install
96
+ ```
89
97
90
98
Once these steps are done, you can run the migrations and run the seeders to get
91
99
started with your Inferno app and start coding for your next big idea.
Original file line number Diff line number Diff line change 26
26
/*Authenticated routes*/
27
27
Route::group (['middleware ' => 'auth ' ], function () {
28
28
Route::get ('/home ' , ['as ' => 'home ' , 'uses ' => 'HomeController@getHomePage ' ]);
29
- Route::get ('/activities ' , ['as ' => 'user-activities ' , 'uses ' => 'HomeController@getUserActivities ' ]);
30
- Route::post ('/logout ' , ['as ' => 'logout ' , 'uses ' => 'HomeController@postLogout ' ]);
29
+ Route::get ('/activities ' , ['as ' => 'user-activities ' , 'uses ' => 'HomeController@getUserActivities ' ]);
30
+ Route::post ('/logout ' , ['as ' => 'logout ' , 'uses ' => 'HomeController@postLogout ' ]);
31
31
32
32
Route::get ('user/profile ' , ['as ' => 'profile ' , 'uses ' => 'HomeController@pageUserProfile ' ]);
33
33
Route::post ('user/profile ' , ['as ' => 'update-profile ' , 'uses ' => 'HomeController@postUpdateProfile ' ]);
You can’t perform that action at this time.
0 commit comments