【install composer】:
[https://getcomposer.org/download/](https://getcomposer.org/download/)
【Laravel website】
[https://laravel.com/](https://laravel.com/)
【Install the specified version of laravel under the selected folder】:
`composer create-project laravel/laravel=5.5.* --prefer-dist filename`
Or download the latest version:
`composer create-project laravel/laravel --prefer-dist filename`
<br/>
【Too long field problem】
When run `php artisan migrate`,Will prompt the data table field is not long enough, this time you need
to in the this location`app\Providers\AppServiceProvider.php`, add the following code:
~~~
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
~~~
That is, the file can be like this:
~~~
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
~~~
At this time, you can do the database migration normally:
`php artisan migrate`
Generate a preset data table, indicating that Laravel has connected to MySQL and can officially start development!
<br/>
【See laravel version】:
`php artisan --version`
- PHP Laravel for beginners: from zero fly to the heaven !
- 1.Getting started with laravel: To do list project
- 1.Course overview
- 2.Install xampp and editor
- 3. Download and run laravel
- 4. MVC concept
- 5.Website structure and blade template engine
- 6.CRUD concept: create, read, update, and delete
- 7.Create data by Tinker
- 8.Create data by Factories
- 9.Read function
- 10.Create function
- 11.Update function
- 12.Delete function
- 13.Course summary
- Laravel common command line
- Laravel package and function
- Account 1: Laravel default auth function
- Account 2: Laravel register, login, logout
- Payment : Laravel PayPal
- Payment 2: Laravel alipay
- Payment 3: Laravel wechatpay
- Template 1: Laravel adminlte template
- MySQL