| 1 | <?php |
||
| 7 | class UserController extends Controller |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Create a new controller instance. |
||
| 11 | * |
||
| 12 | * @return void |
||
|
|
|||
| 13 | */ |
||
| 14 | public function __construct() |
||
| 15 | { |
||
| 16 | $this->middleware('auth'); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function showProfile() |
||
| 24 | |||
| 25 | public function logout() |
||
| 26 | { |
||
| 27 | Auth::logout(); |
||
| 28 | return redirect()->intended('login'); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.