forge/app/Models/License.php

39 lines
826 B
PHP
Raw Normal View History

2024-05-15 00:31:24 -04:00
<?php
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
{
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
}