2024-05-15 00:31:24 -04:00
|
|
|
<?php
|
|
|
|
|
2025-01-30 00:23:55 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-05-15 00:31:24 -04:00
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
class License extends Model
|
|
|
|
{
|
2024-09-12 13:19:52 -04:00
|
|
|
use HasFactory;
|
|
|
|
use SoftDeletes;
|
2024-05-15 00:31:24 -04:00
|
|
|
|
2024-07-20 19:52:36 -04:00
|
|
|
/**
|
|
|
|
* The relationship between a license and mod.
|
2024-09-12 13:19:52 -04:00
|
|
|
*
|
|
|
|
* @return HasMany<Mod>
|
2024-07-20 19:52:36 -04:00
|
|
|
*/
|
2024-05-15 00:31:24 -04:00
|
|
|
public function mods(): HasMany
|
|
|
|
{
|
2024-09-11 15:09:27 -04:00
|
|
|
return $this->hasMany(Mod::class)
|
|
|
|
->chaperone();
|
2024-05-15 00:31:24 -04:00
|
|
|
}
|
2024-10-12 13:18:04 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that should be cast to native types.
|
|
|
|
*/
|
|
|
|
protected function casts(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'hub_id' => 'integer',
|
|
|
|
'created_at' => 'datetime',
|
|
|
|
'updated_at' => 'datetime',
|
|
|
|
'deleted_at' => 'datetime',
|
|
|
|
];
|
|
|
|
}
|
2024-05-15 00:31:24 -04:00
|
|
|
}
|