2019-01-12laravel 使用生成二维码扩展composer require simplesoftwareio/simple-qrcode 1.5.1 // 在config/app.php 注册服务提供者: SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class // 在 config/app.php 添加 QrCode : 'QrCode' => S
2019-01-12laravel 使用PHPmailer扩展composer require phpmailer/phpmailer use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; public function test(){ // echo "ceshi"; $mail = new PHPMailer(true); //
2019-01-12laravel查询sql语句//开启查询日志 \DB::connection()->enableQueryLog(); //执行sql语句 $goods_group = \App\Goods_group::orderBy('sort','desc')->get(); //获取查询日志 $queries = \DB::getQueryLog(); //查看日志内容 dd($queries
2019-01-10laravel 分页自定义原始分页真是太难看了,如上 laravel很人性化的给我们提供了样式,在public/css里面有个app.css文件, 我 们只需要再视图引入它就好了 如果想自定义,可以使用 php artisan vendor:publish laravel把自带的样式拷贝到了我们项目的视图目录下面的vendor文件夹 resources/view/pagination
2019-01-10laravel多条件排序$goods = Goods::orderBy('created_at','desc')->orderBy('id','desc')->paginate(6);
2019-01-10laravel 分页带参数url public/admin/goods?status=0&page=2 c $status = \Request::get('status'); return view("admin/goods/goods",compact('status')); v {{ $goods->appends(['status' => 0])->links() }}
2019-01-10Laravel 出现"RuntimeException inEncrypter.php line 43: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths."问题的解决办法Laravel 出现"RuntimeException inEncrypter.php line 43: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths."问题的解决办法 php artisan key:generate 这时候项目
2019-01-10laravel 在ajax请求下无法保存session无法保存 session(['admin'=>$res[0]]); 可以保存 \Session::put('admin',$res[0]); // 你要保存的session key \Session::save();
2018-12-25laravel | 系统学习笔记五缓存优化 数据库查询缓存优化 数据库字段 show COLUMNS from 'user' //查询数据表的字段 生成数据表的缓存文件 php think optimize:schema //生成的目录在runtime/schema 路由 php think optimize:route //生成的目录在runtime/route.php 权限管理 权限粒度
2018-12-19laravel | 系统学习笔记四公共专题列表 视图合成器 \View::composer('mobandizhi',function($view){ //加载 }) 使用 位置\app\Providers\AppServiceProvider.php public function boot() { \View::composer('layout.sidebar',function($vi
2018-12-18laravel | 系统学习笔记三搜索 elasticsearch https://www.elastic.co/cn/ https://github.com/medcl/elasticsearch-analysis-ik 文档 elasticsearch基本概念 索引index 类型type 文档document 字段field 模板template es标准查询地址 http://loc
2018-12-17laravel | 系统学习笔记二服务容器 绑定(使用bind 或 singleton) public/indx.php下的 $app = require_once __DIR__.'/../bootstrap/app.php'; app.php 下(字符串绑定到对象中) $app->singleton( Illuminate\Contracts\Http\Kernel::class,//字