Viewing file: Restaurant.php (1.26 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Modules\MultiRestaurant\Entities\Review;
class Restaurant extends Model { use HasFactory; protected $fillable=['name','email','phone_number','template','has_reservation','location','timing','user_id','description','profile_image','cover_image','slug','status','currency_code','currency_symbol','order_status','cash_on_delivery','takeaway','table_booking','direction','delivery_fee','on_multi_restaurant','photos','opening_hours','others_information','country','state','featured_restaurant'];
public function user(){ return $this->belongsTo(User::class)->withDefault(); } public function items(){ return $this->hasMany(Item::class); } public function reviews(){ return $this->hasMany(Review::class); } public function tables(){ return $this->hasMany(Table::class); } public function custom_menus(){ return $this->hasMany(CustomMenu::class); }
public function setDescriptionAttribute($value){ $this->attributes['description']=clean($value); } public function restaurant(){ return $this->belongsTo(Restaurant::class,'restaurant_id','id'); } }
|