If there is Route::get('home/test', 'HomeController@index')->name('test');
①href jump in the view
Difference: The most convenient, but it will need to be modified when the route changes
2. >name()
Difference: Directly specify the relevant controller, minimal impact
Difference: most easily affected, not recommended to use
② Use redirect jump in the controller
1. return redirect(' home/test'); <=> return redirect()->to('home/test');
Difference: Same as ① 1
2. return redirect()->action ('HomeController@index');
Difference: Same as ①Three
Three, return redirect()->route(test'');
Difference: Same as ①Two
4. return redirect()->back(); <=> return back();
Instructions: Return to the previous page
③Each resource path constant
1. public_path( 'uploads');
Explanation: public file path
2. base_path('xx');
3. app_path('xx');
4. resource_path('xx ');
The above introduces how to obtain various paths in laravel, including laravel content. I hope it will be helpful to friends who are interested in PHP tutorials.