21 lines
360 B
PHP
21 lines
360 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
use App\Models\Store;
|
|
|
|
class Post extends Model
|
|
{
|
|
protected $table = 'posts';
|
|
protected $fillable = [
|
|
'body'
|
|
];
|
|
|
|
public function stores(): HasMany {
|
|
return $this->hasMany(Store::class, 'post_id');
|
|
}
|
|
}
|