1. First download: https://getcomposer.org/Composer-Setup.exe
2. Set the composer's domestic image: composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
3. Install Laravel:composer global require laravel/installer 如果安装一次不成功,多安装几次,安装成功后如下图
4. New Laravel items:
composer create-project --prefer-dist laravel/laravel myLaravel 或者 laravel new myLaravel
安装成功后如下:
Use the command: php artisan serve
The test is working correctly.
5. Installation Laravel-Admin:
检查laravel 是否安装正确,.env中数据库的配置
数据库的配置:用HeidiSQL 创建新的数据库和用户名,密码,修改.env中的数据库配置:
But also set the path of access:
config / filesystems.php add the following, otherwise it will error.
然后执行 : composer require encore/laravel-admin
发布资源: php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"
安装laravel-admin : php artisan admin:install
登录界面的标题和首页的logo都在config/admin.php下设置。
6.新建数据库迁移表:php artisan make:migration addMovie --create="movies"
修改database\migrations\同步文件中的up方法。 执行:php artisan migrate 进行同步数据库
7.在app\Admin目录下创建Models目录,复制User.php文件到新的模型文件,修改继承类为Model.
The model generation Controller: php artisan admin: make MovieController --model = App \ Admin \ Models \ Movie
9. Modify routes.php, new routing resources:
10. Log management background, account password admin / admin,
11. Add the corresponding menu:
Opposite the input path, the system will automatically become
This form of a CRUD is complete.