This article mainly introduces the Laravel framework routing and use, combined with the example form analysis of the Laravel framework routing method, related operation considerations, the need for friends can refer to the following
This article describes the Laravel framework routing settings and usage. Share to everyone for your reference, as follows:
Laravel installation, use one-click installation package here.
Use PHP's built-in Web server to run the command line under the PHP folder
Php-s 0.0.0.0:1024
I. Setting up a route
Route file in app\http\routes.php, add in code
Route::get ('/hi ', function () { return ' Hello World ';});
We have observed that this PHP file already has
Route::get ('/', function () { return view (' Welcome ');});
Therefore, the routing file specifies which view the URL is to turn to.
Laravel load slowly Ah! Mainly refers to the Google font, while the CDN speed is not fast, we can change the referenced resources to static resources
Locate the app.blade.php file under directory \resources\views\layouts , and change the CSS reference to
<!--Fonts--><link href= "font-awesome.min.css" rel= "external nofollow" rel= ' stylesheet ' type= ' text/css ' > <link href= "Css.css" rel= "external nofollow" rel= ' stylesheet ' type= ' text/css ' ><!--Styles--><link href = "Bootstrap.min.css" rel= "external nofollow" rel= "stylesheet" >
The speed is coming soon!
Two. Install the certification system
Installing using the Artisan command line
PHP Artisan Make:auth
Now go to the Laravel folder and observe that there is an. env file and. env.example file generation, and we edit the. env file to configure the MySQL database
Db_host=127.0.0.1db_port=3306db_database=homesteaddb_username=homesteaddb_password=secret
Then we use Laravel's migrate to migrate the database
PHP Artisan Migrate
When this step is completed, 3 new tables have been created in the MySQL database.
Access URL:http://127.0.0.1:1024/laravel/public/login
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!