随笔分类 - Laravel
摘要:1.https://packagist.org 2.http://packalyst.com
阅读全文
摘要:https://laravelacademy.org/post/9043.html 使用laravel此扩展组件处理 https://developers.facebook.com/apps/?show_reminder=true 登录facebook后首先创建自己的应有创建facebook登录商品
阅读全文
摘要:常规导出xlsx 更多的是导出小数据 需要大数据导出的时候 需要临时更改内存大小 ini_set('memory_limit', '1024M'); 不更改内存的情况 可以选择队列导出到服务器后另行下载; 导出csv 由于一般浏览器都是默认解析输出模式 所以一般加header头 这里说两种: 1/
阅读全文
摘要:php artisan migrate --path=database/migrations/new
阅读全文
摘要:1/ config/logging.php 文件下 配置一个自定义 'cache' => [ 'driver' => 'daily', 'path' => storage_path('logs/cache/laravel.log'), 'level' => env('LOG_LEVEL', 'deb
阅读全文
摘要:导出功能: maatwebsite/excel 使用此组件用作导出,效果比较友好,但是感觉导入就不太友好 导入: box/spout 推荐使用这个组件 导入效果比较好-- https://opensource.box.com/spout/getting-started/#reader 生成一个导入类
阅读全文
摘要:Carbon::parse('2021-02-26T09:22:33.196Z', 'UTC')->setTimezone('PRC')->format('Y-m-d H:i:s') // "2021-02-26 17:22:33 Carbon::createFromTimestampMs('162
阅读全文
摘要:crontab -e #添加代码 * * * * * /usr/bin/php7.0 /var/www/html/laravel/artisan schedule:run >> /dev/null 2>&1 注意:/usr/bin/php7.0为你的php位置 ,* * * * *分别代表 分 时
阅读全文
摘要:注: {{!! $url !!}} 也可以用js在后台代码中实现,只是会刷新两次
阅读全文
摘要:源地址:https://www.kancloud.cn/logoove/we7/1442125 Box/Spout处理excel和csv 导出csv和xlsx use Box\Spout\Writer\WriterFactory; use Box\Spout\Common\Type; $result
阅读全文
摘要:Laravel 服务容器 发现一篇讲服务容器的文章,讲的很好,转载过来laravel 服务容器 实质是工厂模式的升级,类的传递动态加载 ####以下内容转载 容器,字面上理解就是装东西的东西。常见的变量、对象属性等都可以算是容器。一个容器能够装什么,全部取决于你对该容器的定义。当然,有这样一种容器,
阅读全文
摘要:优惠卷主表 和 领取表的关联 目的查询有效优惠卷(还有可领取的数量)
阅读全文
摘要:public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false) { // If the first "column" of the join is really a
阅读全文
摘要:model.php文件\\ use Illuminate\Database\Eloquent\Builder;use Illuminate\Database\Eloquent\Relations\Relation;use Illuminate\Database\Eloquent\Relations\
阅读全文
摘要:事件系统 拥有多个互不依赖的监听器; 就是说你有多少的业务事件 可以开辟多少个事件与监听者的组合去处理;这样就可以有效的避免冲突 首先 我们需要注册一个时间类 比如订单的 orderEvent 在该App\Providers\EventServiceProvider文件中注册应用的事件类 order
阅读全文
摘要:diff 方法 与 php内置函数 array_diff返回俩数组的差集 返回 [1,3,5]
阅读全文
摘要:truecontains() 方法 类似于 php函数 in_array() 通过 collect 实例一个集合 来判断是否包含值 若是二维数组 需要指定 键值对 同时比较 返回true $collection = collect([1, 2, 3, 6]); $data = $collection
阅读全文
摘要:distinct -- 去重查询 他是指行与行之间的去重 意味着 他 会比较所有行中 你查询的字段是否相同 相同则去重
阅读全文