Laravel Study Notes (1) to generate the resource controller (Preface, can not be redirected)

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.

  1. Generating resource controller
artisan make:controller --resource UserController 
  1. View the currently available routing
artisan route:list
  1. Add routes in the routing settings file
// 路由重命名
Route::get('/', 'IndexController@home')->name('home');

// 新建资源路由器
Route::resource('user', 'UserController');

  1. View created corresponding jump, which
// {{}} 类似于 <?php echo $e; ?>
{{ route('user.create') }}
  1. 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,

Published 40 original articles · won praise 0 · Views 792

Guess you like

Origin blog.csdn.net/qj4865/article/details/104075893