Preface:
This study notes the use of self-laravel framework, code and documentation information from the Internet (the main source: B station to the military uncle , Li Ang lifelong learning ), and comment them according to their own understanding.
- Generating resource controller
artisan make:controller --resource UserController
- View the currently available routing
artisan route:list
- Add routes in the routing settings file
// 路由重命名
Route::get('/', 'IndexController@home')->name('home');
// 新建资源路由器
Route::resource('user', 'UserController');
- View created corresponding jump, which
// {{}} 类似于 <?php echo $e; ?>
{{ route('user.create') }}
- After the jump to create routing method provided in the controller
** PS: If the situation can not be redirected appear, usually can not redirect apache, .htaccess reason is turned off, this time in general to troubleshoot the following questions **:
1, .htaccess public file path exists and the configuration is correct
2, conf / httpd.conf file,
#LoadModule rewrite_module modules/mod_rewrite.so
Changed
LoadModule rewrite_module modules/mod_rewrite.so
3, conf / httpd.conf file, the configuration
<Directory "F:\PHP soft\php\www\blog\public">
AllowOverride All
Options Indexes FollowSymLinks
Require all granted
</Directory>
Wherein, Directory containing .htaccess must point path,