重新格式化
This commit is contained in:
parent
0db209ba72
commit
bdf5f1f0c1
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\User\HostRequest;
|
||||
use App\Jobs\Module\HostJob;
|
||||
use App\Models\Host;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
@ -60,7 +61,7 @@ public function destroy(HostRequest $request, Host $host): JsonResponse
|
||||
$host->cost();
|
||||
}
|
||||
|
||||
dispatch(new \App\Jobs\Module\HostJob($host, 'delete'));
|
||||
dispatch(new HostJob($host, 'delete'));
|
||||
|
||||
return $this->deleted($host);
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
/**
|
||||
* App\Models\Admin
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property string|null $remember_token
|
||||
* @property int $id
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property string|null $remember_token
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @method static Builder|Admin newModelQuery()
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
class Admin extends Authenticatable
|
||||
{
|
||||
use HasFactory, Cachable;
|
||||
use Cachable;
|
||||
|
||||
protected $table = 'admins';
|
||||
|
||||
|
@ -13,17 +13,17 @@
|
||||
/**
|
||||
* App\Models\Balance
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $order_id
|
||||
* @property string|null $trade_id
|
||||
* @property string|null $payment
|
||||
* @property string $amount
|
||||
* @property string $remaining_amount
|
||||
* @property string|null $paid_at
|
||||
* @property int|null $user_id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User|null $user
|
||||
* @property int $id
|
||||
* @property string|null $order_id
|
||||
* @property string|null $trade_id
|
||||
* @property string|null $payment
|
||||
* @property string $amount
|
||||
* @property string $remaining_amount
|
||||
* @property string|null $paid_at
|
||||
* @property int|null $user_id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User|null $user
|
||||
* @method static CachedBuilder|Balance all($columns = [])
|
||||
* @method static CachedBuilder|Balance avg($column)
|
||||
* @method static CachedBuilder|Balance cache(array $tags = [])
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Events\UserEvent;
|
||||
use App\Jobs\Module\HostJob;
|
||||
use App\Models\WorkOrder\WorkOrder;
|
||||
use GeneaLabs\LaravelModelCaching\CachedBuilder;
|
||||
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
||||
@ -15,23 +16,23 @@
|
||||
/**
|
||||
* App\Models\Host
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $module_id
|
||||
* @property int $user_id
|
||||
* @property float $price
|
||||
* @property float|null $managed_price
|
||||
* @property mixed|null $configuration
|
||||
* @property string $status
|
||||
* @property int|null $hour
|
||||
* @property Carbon|null $suspended_at
|
||||
* @property string|null $deleted_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Module $module
|
||||
* @property-read User $user
|
||||
* @property-read Collection|WorkOrder[] $workOrders
|
||||
* @property-read int|null $work_orders_count
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $module_id
|
||||
* @property int $user_id
|
||||
* @property float $price
|
||||
* @property float|null $managed_price
|
||||
* @property mixed|null $configuration
|
||||
* @property string $status
|
||||
* @property int|null $hour
|
||||
* @property Carbon|null $suspended_at
|
||||
* @property string|null $deleted_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Module $module
|
||||
* @property-read User $user
|
||||
* @property-read Collection|WorkOrder[] $workOrders
|
||||
* @property-read int|null $work_orders_count
|
||||
* @method static CachedBuilder|Host active()
|
||||
* @method static CachedBuilder|Host all($columns = [])
|
||||
* @method static CachedBuilder|Host avg($column)
|
||||
@ -137,7 +138,7 @@ protected static function boot()
|
||||
|
||||
// when Updated
|
||||
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_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;
|
||||
}
|
||||
|
||||
|
@ -12,16 +12,16 @@
|
||||
/**
|
||||
* App\Models\PersonalAccessToken
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $tokenable_type
|
||||
* @property int $tokenable_id
|
||||
* @property string $name
|
||||
* @property string $token
|
||||
* @property array|null $abilities
|
||||
* @property Carbon|null $last_used_at
|
||||
* @property Carbon|null $expires_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int $id
|
||||
* @property string $tokenable_type
|
||||
* @property int $tokenable_id
|
||||
* @property string $name
|
||||
* @property string $token
|
||||
* @property array|null $abilities
|
||||
* @property Carbon|null $last_used_at
|
||||
* @property Carbon|null $expires_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Model|Eloquent $tokenable
|
||||
* @method static CachedBuilder|PersonalAccessToken all($columns = [])
|
||||
* @method static CachedBuilder|PersonalAccessToken avg($column)
|
||||
|
@ -18,15 +18,15 @@
|
||||
/**
|
||||
* App\Models\Task
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $title
|
||||
* @property int $progress
|
||||
* @property string $status
|
||||
* @property int $user_id
|
||||
* @property int $host_id
|
||||
* @property string $id
|
||||
* @property string $title
|
||||
* @property int $progress
|
||||
* @property string $status
|
||||
* @property int $user_id
|
||||
* @property int $host_id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Host $host
|
||||
* @property-read Host $host
|
||||
* @method static CachedBuilder|Task all($columns = [])
|
||||
* @method static CachedBuilder|Task avg($column)
|
||||
* @method static CachedBuilder|Task cache(array $tags = [])
|
||||
@ -62,8 +62,6 @@
|
||||
*/
|
||||
class Task extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $incrementing = false;
|
||||
protected $fillable = [
|
||||
'host_id',
|
||||
|
@ -15,15 +15,15 @@
|
||||
/**
|
||||
* App\Models\WorkOrder\Reply
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $content
|
||||
* @property int $work_order_id
|
||||
* @property int|null $user_id
|
||||
* @property int $is_pending
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User|null $user
|
||||
* @property-read WorkOrder $workOrder
|
||||
* @property int $id
|
||||
* @property string $content
|
||||
* @property int $work_order_id
|
||||
* @property int|null $user_id
|
||||
* @property int $is_pending
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User|null $user
|
||||
* @property-read WorkOrder $workOrder
|
||||
* @method static CachedBuilder|Reply all($columns = [])
|
||||
* @method static CachedBuilder|Reply avg($column)
|
||||
* @method static CachedBuilder|Reply cache(array $tags = [])
|
||||
|
@ -19,20 +19,20 @@
|
||||
/**
|
||||
* App\Models\WorkOrder\WorkOrder
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property string $content
|
||||
* @property int $user_id
|
||||
* @property string $module_id
|
||||
* @property int|null $host_id
|
||||
* @property string $status
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Host|null $host
|
||||
* @property-read Module $module
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property string $content
|
||||
* @property int $user_id
|
||||
* @property string $module_id
|
||||
* @property int|null $host_id
|
||||
* @property string $status
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Host|null $host
|
||||
* @property-read Module $module
|
||||
* @property-read Collection|Reply[] $replies
|
||||
* @property-read int|null $replies_count
|
||||
* @property-read User $user
|
||||
* @property-read int|null $replies_count
|
||||
* @property-read User $user
|
||||
* @method static CachedBuilder|WorkOrder all($columns = [])
|
||||
* @method static CachedBuilder|WorkOrder avg($column)
|
||||
* @method static CachedBuilder|WorkOrder cache(array $tags = [])
|
||||
|
Loading…
Reference in New Issue
Block a user