laravel

2024-03-15 0 1
手机查看

服务器上清理:php artisan optimize php artisan cache:clear

\DB::listen(function($query) {
    $bindings = $query->bindings;
    $sql = $query->sql;
    foreach ($bindings as $replace){
        $value = is_numeric($ replace) ? $replace : "'".$ replace."'";
        $sql = preg_replace('/\?/', $value, $sql, 1);
    }
    dump($sql);
});
动作 URI 行为 路由名称
GET /photos index photos.index
GET /photos/create create photos.create
POST /photos store photos.store
GET /photos/{photo} show photos.show
GET /photos/{photo}/edit edit photos.edit
PUT/PATCH /photos/{photo} update photos.update
DELETE /photos/{photo} destroy photos.destroy

基本队列 artisan 命令

queue:队列   php artisan help queue  帮助  help

php artisan make:job  namexxx  创建队列会在 app/jobs 下生成队列文件

php artisan queue:table   生成队列成功 job 数据库迁移

php artisan queue:failed-table  生成队列失败 fail-job 数据库迁移

php artisan queue:failed  查看失败队列列表

php artisan queue:listen  监听队列

php artisan queue:work  执行队列

php artisan queue:flush  删除所有队列

php artisan queue:forget -参数删除某个

php artisan queue:retry -参数 id  重新执行某个队列

php artisan queue:restart 重启所有队列

What do you think?
  • 点赞
    0
    点赞
  • 踩一下
    0
    踩一下
  • 酷毙了
    0
    酷毙了
  • 不屑
    0
    不屑
  • 尴尬
    0
    尴尬
  • 无聊
    0
    无聊
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.5.6