随笔分类 -  laravel

摘要:http://www.cnblogs.com/webskill/category/1067140.html laravel 5.4 新特性 component and slot 使用: 1.component panel Hello World Lorem ipsum dolor sit amet, 阅读全文
posted @ 2018-08-16 11:32 miyaye 阅读(268) 评论(0) 推荐(0) 编辑
摘要:middleware php artisan make:middleware isAdminMiddleware user表增加is_admin字段 值为 Y/N 模型user.php public function isAdmin(){ return $this is_admin == 1; } 阅读全文
posted @ 2017-09-04 10:27 miyaye 阅读(174) 评论(0) 推荐(0) 编辑
摘要:事件监听 方法一: web.php Event::listen('eloquent.created: App\post',function(){ dump('A post was created'); }); Route::get('/event53',function(){ \App\post:: 阅读全文
posted @ 2017-09-03 15:54 miyaye 阅读(424) 评论(0) 推荐(0) 编辑
摘要:实时facade 1. 创建一个目录叫services 创建一个weibo类 http = $http; } public function publish($status){ $this http post($status); } } 创建一个Http类 阅读全文
posted @ 2017-09-03 15:22 miyaye 阅读(285) 评论(0) 推荐(0) 编辑
摘要:laravel 邮件使用markdown php artisan make:mail lessonPublished markdown="emails.published" 这个命令不仅创建了email类文件 还生成了视图文件 并把视图也写好了 return $this markdown('emai 阅读全文
posted @ 2017-09-03 15:02 miyaye 阅读(336) 评论(0) 推荐(0) 编辑
摘要:component and slot 使用: 1.component panel Hello World Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque risus mi, tempus quis place 阅读全文
posted @ 2017-09-03 14:46 miyaye 阅读(232) 评论(0) 推荐(0) 编辑
摘要:mail篇 public function via($notifiable) { return ['mail']; } 1.新建notification类 php artisan make:notification PostNotification 2.设置路由 //notification 注意默 阅读全文
posted @ 2017-09-01 18:45 miyaye 阅读(966) 评论(0) 推荐(0) 编辑
摘要:toggle方法主要用于多对多关系中,attach detach 比如点赞 收藏 1.user表 2.post表 title content 3.中间表 favoriate user_id post_id 4.user中定义关系 public function favorites(){ return 阅读全文
posted @ 2017-09-01 17:53 miyaye 阅读(616) 评论(0) 推荐(0) 编辑
摘要:本文使用qq邮箱 env邮件配置: MAIL_FROM_ADDRESS = 17 92@qq.com MAIL_FROM_NAME = listen~ MAIL_DRIVER=smtp MAIL_HOST=smtp.qq.com MAIL_PORT=465 MAIL_USERNAME=17 2@qq 阅读全文
posted @ 2017-09-01 17:13 miyaye 阅读(169) 评论(0) 推荐(0) 编辑
摘要:1.tinker 造假数据 ~~~~ factory('App\User',3) create(); ~~~~ DB::table 返回collection,可以用collection中的很多方法 比如 all() first(),这是5.3以后的新特性 5.2返回的是数组 ~~~~ DB::tab 阅读全文
posted @ 2017-09-01 15:34 miyaye 阅读(226) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2017-09-01 14:42 miyaye 阅读(1) 评论(0) 推荐(0) 编辑
摘要:LARAVEL NOTES {{toc}} laravel简介 laravel对php版本要求 laravel5 要求php 5.59 laravel 配置nginx后无法访问 给laravel下所有文件给读写权限 laravel配置文件 ~~~ server { listen 80; server 阅读全文
posted @ 2017-09-01 11:49 miyaye 阅读(249) 评论(0) 推荐(0) 编辑
摘要:表单验证方法1: 使用validate方法 ~~~~ public function store(Request $request){ $this validate($request, [ 'title' = 'required|unique:posts|max:255', 'body' = 're 阅读全文
posted @ 2017-09-01 11:42 miyaye 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-08-27 09:43 miyaye 阅读(314) 评论(0) 推荐(0) 编辑