项目:在线教育平台

功能…….

安装:

1、composer create-project laravel/laravel --prefer-dist    //默认7.0版本

2、修改时区:config/app.php 'timezone'=>'prc';

3、下载语言包 https://packagist.org/packages/caouecs/laravel-lang
命令:composer require caouecs/laravel-lang:~3.0 //切记选对版本号
将语言包文件 vendor/caouecs/laravel-lang/src/zh-cn 复制到resources/lang/zh-cn目录下
修改config/app.php中的关于本地化的配置项:locale
'locale'=>'zh-cn';


4、配置数据库的连接,需要修改根目录配置文件.env
推荐禁用mysql的严格模式,需要修改文件config/database.php:
'strict'=>false,


5、删除系统自带额度非必要性文件
删除app/user.php模型文件
删除app/http/controllers/auth目录:
删除database/migrations目录和database/seeds目录下的全部文件
删除public下的js和css目录:
删除resources/views下的全部文件:

6、(可选)安装debugbar工具条,要求php版本大于等于7.0

  地址:https://github.com/barryvdh/laravel-debugbar/tree/2.4

  命令:composer require barryvdh/laravel-debugbar:~2.4

  安装好之后添加config/app.php中的providers和aliases数组的配置: 

  providers中加 barryvdh\debugbar\serviceprovider::class,

  aliases数组中加’debugbar’ => barryvdh\debugbar\facade::class,

  7、配置服务器 测试环境  php7.3 nginx1.15 mysql5.7

  网站目录选择laravel文件夹下的 public文件夹

 nginx配置

server{
        listen 80;
        server_name  www.ll.com;
        root "d:/phpstudy_pro/www/laravel/public"; # 该项要修改为你准备存放相关网页的路径
        
        index index.html index.php index.htm; 
        
        location / {
           try_files $uri $uri/ /index.php?$query_string;
        }
        
        location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?u).+\.php)(/?.+)$;
            fastcgi_param  script_filename  $document_root$fastcgi_script_name;
            fastcgi_param  path_info  $fastcgi_path_info;
            fastcgi_param  path_translated  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
    }