Mini Shell
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Board extends Model
{
use HasFactory;
/**
* Table name.
*
* @var string
*/
protected $table = 'board';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
];
/**
* Get the groups for the board.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function groups(){
return $this->hasMany(Group::class);
}
/**
* Get the cards for the board.
*
* @return \Illuminate\Database\Eloquent\Relations\hasManyThrough
*/
public function cards(){
return $this->hasManyThrough(Card::class, Group::class);
}
}
Zerion Mini Shell 1.0