![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Laravel
Adolph丶
菜鸟一枚
展开
-
lnmp 环境require(): open_basedir restriction in effect 错误
准备把laravel项目部署到lnmp环境的时候出现了500错误先开启 php.ini 中的错误提示 display_error= On接下来我们会看到这个是open_basedir设置的问题,因为laravel的访问目录是/publiccd /usr/local/nginx/ 到安装nginx的目录中grep -rn open_basedir ./ 搜索这个出现...原创 2018-08-20 23:45:08 · 1856 阅读 · 0 评论 -
Laravel 创建自定义的 artisan make 命令
我在项目中用到了repository 模式 需要新创建repository模板,我在想是不是也用命令生成来比较好一些,我搜了一些命令找到 相对应的文件 Illuminate\Foundation\Console\ProviderMakeCommand Illuminate\Routing\Console\ControllerMakeCommand...原创 2018-08-22 00:46:54 · 4021 阅读 · 0 评论 -
Laravel 事务处理传递参数与添加数据后如何返回主键
传递参数使用匿名函数use来传递参数,参考(http://www.jicker.cn/5846.html);返回添加数据的主键可以用 $aid->id 方式返回;public function create(array $data){ DB::transaction(function () use ($data) { $mid = parent::cr...原创 2018-09-10 23:06:45 · 1395 阅读 · 0 评论 -
Could not scan for classes inside "database/factories" which does not appear to be a file nor a fold
Laravel 5.6 报错 Could not scan for classes inside "database/factories" which does not appear to be a file nor a folder只需要在 database目录下面 新建一个名为 factories 的文件夹就可以 ...原创 2018-10-17 15:01:45 · 3899 阅读 · 0 评论 -
Laravel 发送邮件
生成邮件php artisan make:mail Email 生成文件在 app\Mail\Email 目录设置邮件类<?phpnamespace App\Mail;use Illuminate\Bus\Queueable;use Illuminate\Mail\Mailable;use Illuminate\Queue\SerializesModels...原创 2018-10-23 22:47:28 · 255 阅读 · 0 评论