Update
This commit is contained in:
@@ -7,30 +7,45 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class UserUsage
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $non_watermark_videos_left
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class UserUsage extends Model
|
||||
{
|
||||
protected $table = 'user_usages';
|
||||
protected $table = 'user_usages';
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'non_watermark_videos_left' => 'int'
|
||||
];
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'non_watermark_videos_left' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'non_watermark_videos_left'
|
||||
];
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'non_watermark_videos_left',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'id',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
protected $appends = ['ids'];
|
||||
|
||||
protected function ids(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value, $attributes) => hashids_encode($attributes['id']),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user