laravel5.5 Installation

Source: Internet
Author: User

This article mainly introduces about the laravel5.5 installation, has a certain reference value, now share to everyone, the need for friends can refer to the

Step one: How to install the composer 11. Locate and enter the installation directory for PHP (and the PHP instructions you execute on the command line should be the same set of PHP). 2. Copy the Composer.phar to the PHP installation directory, which is the same level directory as Php.exe. 3. Create a new Composer.bat file in the PHP installation directory and save the following code to this file. @php "%~dp0composer.phar"%* finally reopen a command-line window and try executing composer--version to see if the version number is correctly printed. Composer Installation Method II (recommended novice First this) run Composerset.exe until successful. Step two: Modify Chinese mirror composer Config-g repo.packagist composer https:// Packagist.phpcomposer.com Step three: Install Laravel command Method 1: command-line installation Remember to switch to the WWW directory (install laravel) composer Create-project laravel/laravel=  5.5.*--prefer-dist initialization command: PHP artisan package:discoverphp Artisan Key:generate then wait, the speed is slow. Understand, a total of 20 trillion method two: one-click installation package Download     Go to laravel College download Download complete put to www directory to run the fourth step: after the installation is complete, we enter Laravel College. http://laravelacademy.org/post/5671.html first introduced PHP artisan into the command line input PHP artisan See what commands can be added 5.3 manual maintenance mode PHP artisan down php ar Tisan Up Maintenance Mode page resources/views/errors/503.blade.php describes the directory structure routing middleware operations database. env directory get started, other self-view middleware: Can be understood as a wall, A wall route that intercepts unauthorized access: can be understood as code executed by URLs, and routed to determine their relationship façade: aliases, which correspond to a class getpostdeleteput and so on to prevent csrf attacks, Cross-domain Request forgery Redirect method used to page jump using middleware three steps: 1. Creating middleware PHP ArtisThe validation code for an Make:middleware usermiddleware middleware is written in the public function handle ($request, Closure $next) {if ($request->INP        UT (' status ')! = ' 0 ') {return redirect (' index ');    } return $next ($request);   }2. Register middleware ' user ' and \app\http\middleware\usermiddleware::class, in such a format as in app\kernel.php Routemiddleware attribute 3. Middleware method applied to route call Route route::get ('/user ', function () {return ' middleware ';}) ->middleware (' user '); How to create a controller: PHP artisan make:controller Usercontroller Route Call controller method route::get ('/user ', ' Usercontroller@index '); operate the database in two ways db and model$users = db::table (' users ')->select (' name ', ' email ')->get (); Query the users table for name and email field db::table (' users ')->delete (3) To delete the users table with the ID 3 record user::create ($request->all ());        The users table creates a new record $user = User::find (1);        $user->name = $request->name; $user->save (); Edit the name of the record with ID 1

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.