first commit
This commit is contained in:
27
app/Models/ForeignKey.php
Normal file
27
app/Models/ForeignKey.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ForeignKey extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'table_id',
|
||||
'constraint_name',
|
||||
'column_name',
|
||||
'referenced_table',
|
||||
'referenced_column',
|
||||
'on_update',
|
||||
'on_delete',
|
||||
];
|
||||
|
||||
public function table(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Table::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user