first commit
This commit is contained in:
commit
836bdc9409
584 files changed
+40891
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace App\Models\System;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Models\Auth\Admin;
|
||||
|
||||
class Tasks extends \App\Models\BaseModel {
|
||||
|
||||
protected $table = 'system_tasks';
|
||||
protected $fillable = [];
|
||||
protected $hidden = ['deleted_at'];
|
||||
protected $append = ['url'];
|
||||
|
||||
public function url(): Attribute{
|
||||
return Attribute::make(
|
||||
get: fn (mixed $value, array $data) => Storage::disk('public')->url($data['file']),
|
||||
);
|
||||
}
|
||||
|
||||
public function user() {
|
||||
return $this->belongsTo(Admin::class, 'user_id', 'uid');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user