34 lines
622 B
PHP
34 lines
622 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Tool extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'description',
|
|
'discovery_url',
|
|
'api_key',
|
|
'data',
|
|
'user_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'data' => 'array',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function functions(): HasMany
|
|
{
|
|
return $this->hasMany(ToolFunction::class);
|
|
}
|
|
}
|