Routing settings for the Laravel framework

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.