2024-07-23 15:22:09 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2024-07-23 16:40:56 +00:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2024-07-23 15:22:09 +00:00
|
|
|
|
|
|
|
class Tool extends Model
|
|
|
|
{
|
2024-07-23 16:40:56 +00:00
|
|
|
protected $fillable = [
|
|
|
|
'name',
|
|
|
|
'description',
|
2024-07-24 08:13:16 +00:00
|
|
|
'discovery_url',
|
2024-07-23 16:40:56 +00:00
|
|
|
'api_key',
|
2024-07-24 08:13:16 +00:00
|
|
|
'data',
|
2024-07-23 16:40:56 +00:00
|
|
|
'user_id',
|
|
|
|
];
|
|
|
|
|
2024-07-24 08:13:16 +00:00
|
|
|
protected $casts = [
|
|
|
|
'data' => 'array',
|
|
|
|
];
|
|
|
|
|
2024-07-23 16:40:56 +00:00
|
|
|
public function user(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function functions(): HasMany
|
|
|
|
{
|
|
|
|
return $this->hasMany(ToolFunction::class);
|
|
|
|
}
|
|
|
|
|
2024-07-23 15:22:09 +00:00
|
|
|
}
|