Categorias
This commit is contained in:
@@ -10,6 +10,14 @@ class Categoria extends Model {
|
||||
use UuidPrimaryKey, SoftDeletes;
|
||||
|
||||
protected $table = 'categorias';
|
||||
protected $fillable = ['id', 'nombre', 'restaurante_id'];
|
||||
|
||||
public static function findOrFail($id) {
|
||||
$categoria = Categoria::find($id);
|
||||
if(!$categoria) throw new ModelNotFoundException("categoria", $id);
|
||||
return $categoria;
|
||||
}
|
||||
|
||||
|
||||
public function restaurante() {
|
||||
return $this->belongsTo(Restaurante::class);
|
||||
|
||||
Reference in New Issue
Block a user