用户配置转移

This commit is contained in:
2022-11-01 16:39:45 +08:00
parent 719a9ff89d
commit 87e650b2f1
14 changed files with 461 additions and 33 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use App\Models\Traits\BelongsToUser;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -11,16 +12,12 @@ use Illuminate\Support\Str;
class Dynamic extends Model
{
use SoftDeletes;
use BelongsToUser;
protected $casts = [
'pictures' => 'json',
];
public function user()
{
return $this->belongsTo(User::class);
}
public function getPicturesUrlAttribute(): array
{
$pictures = $this->getAttribute('pictures');