重新格式化
This commit is contained in:
parent
0db209ba72
commit
bdf5f1f0c1
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\User\HostRequest;
|
use App\Http\Requests\User\HostRequest;
|
||||||
|
use App\Jobs\Module\HostJob;
|
||||||
use App\Models\Host;
|
use App\Models\Host;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
@ -60,7 +61,7 @@ public function destroy(HostRequest $request, Host $host): JsonResponse
|
|||||||
$host->cost();
|
$host->cost();
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(new \App\Jobs\Module\HostJob($host, 'delete'));
|
dispatch(new HostJob($host, 'delete'));
|
||||||
|
|
||||||
return $this->deleted($host);
|
return $this->deleted($host);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
class Admin extends Authenticatable
|
class Admin extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasFactory, Cachable;
|
use Cachable;
|
||||||
|
|
||||||
protected $table = 'admins';
|
protected $table = 'admins';
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Events\UserEvent;
|
use App\Events\UserEvent;
|
||||||
|
use App\Jobs\Module\HostJob;
|
||||||
use App\Models\WorkOrder\WorkOrder;
|
use App\Models\WorkOrder\WorkOrder;
|
||||||
use GeneaLabs\LaravelModelCaching\CachedBuilder;
|
use GeneaLabs\LaravelModelCaching\CachedBuilder;
|
||||||
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
||||||
@ -137,7 +138,7 @@ protected static function boot()
|
|||||||
|
|
||||||
// when Updated
|
// when Updated
|
||||||
static::updated(function ($model) {
|
static::updated(function ($model) {
|
||||||
dispatch(new \App\Jobs\Module\HostJob($model, 'patch'));
|
dispatch(new HostJob($model, 'patch'));
|
||||||
|
|
||||||
Cache::forget('user_hosts_' . $model->user_id);
|
Cache::forget('user_hosts_' . $model->user_id);
|
||||||
Cache::forget('user_tasks_' . $model->user_id);
|
Cache::forget('user_tasks_' . $model->user_id);
|
||||||
@ -213,7 +214,7 @@ public function safeDelete(): bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(new \App\Jobs\Module\HostJob($this, 'delete'));
|
dispatch(new HostJob($this, 'delete'));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +62,6 @@
|
|||||||
*/
|
*/
|
||||||
class Task extends Model
|
class Task extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
|
||||||
|
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'host_id',
|
'host_id',
|
||||||
|
Loading…
Reference in New Issue
Block a user