Monday, March 5, 2018

Laravel boilerplate send object to controller - development

Laravel boilerplate send object to controller

I am newbie with Laravel. I have just fork laravel 5 boilerplate from https://github.com/rappasoft/laravel-5-boilerplate.

In route files, i see that there is a line like that :

Route::group(['prefix' => 'user/{deletedUser}'], function () {
                Route::get('delete', 'UserStatusController@delete')->name('user.delete-permanently');
                Route::get('restore', 'UserStatusController@restore')->name('user.restore');
            });

I understand it means that, when url catch ‘restore’ it will use function restore in UserStatusController.

And here it is:

public function restore(User $deletedUser, ManageUserRequest $request)

Can anybody can help me to find out that, how can it send object $deletedUser to restore function. Tks you!



from Laravel Questions and Answers https://laravelquestions.com/php/laravel-boilerplate-send-object-to-controller/
via Lzo Media

No comments:

Post a Comment