Initial commit
This commit is contained in:
21
app/Models/Footer.php
Normal file
21
app/Models/Footer.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Footer extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'footer';
|
||||
|
||||
protected $fillable = [
|
||||
'links'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'links' => 'array',
|
||||
];
|
||||
}
|
||||
29
app/Models/Homepage.php
Normal file
29
app/Models/Homepage.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Homepage extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'homepage';
|
||||
|
||||
protected $fillable = [
|
||||
'photo',
|
||||
'photo_mobile',
|
||||
'photo_menu',
|
||||
'title',
|
||||
'body',
|
||||
'address',
|
||||
'delivery',
|
||||
'opening_hours',
|
||||
'widget_link'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'opening_hours' => 'array',
|
||||
];
|
||||
}
|
||||
22
app/Models/Ingredient.php
Normal file
22
app/Models/Ingredient.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Models\Product;
|
||||
|
||||
class Ingredient extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'sort_order',
|
||||
];
|
||||
|
||||
public function products()
|
||||
{
|
||||
return $this->belongsToMany(Product::class);
|
||||
}
|
||||
}
|
||||
21
app/Models/Link.php
Normal file
21
app/Models/Link.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Link extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'link';
|
||||
|
||||
protected $fillable = [
|
||||
'links'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'links' => 'array',
|
||||
];
|
||||
}
|
||||
20
app/Models/NavigationLink.php
Normal file
20
app/Models/NavigationLink.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class NavigationLink extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'navigation_links';
|
||||
|
||||
protected $fillable = [
|
||||
'sort_order',
|
||||
'name',
|
||||
'link',
|
||||
'external'
|
||||
];
|
||||
}
|
||||
20
app/Models/Photo.php
Normal file
20
app/Models/Photo.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Photo extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'photos';
|
||||
|
||||
protected $fillable = [
|
||||
'sort_order',
|
||||
'name',
|
||||
'description',
|
||||
'photo'
|
||||
];
|
||||
}
|
||||
34
app/Models/Product.php
Normal file
34
app/Models/Product.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'products';
|
||||
|
||||
protected $fillable = [
|
||||
'sort_order',
|
||||
'category',
|
||||
'products',
|
||||
'description'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'products' => 'array',
|
||||
];
|
||||
|
||||
public function ingredients()
|
||||
{
|
||||
return Ingredient::whereIn('id', collect($this->products ?? [])
|
||||
->pluck('ingredients')
|
||||
->flatten()
|
||||
->unique()
|
||||
->toArray()
|
||||
);
|
||||
}
|
||||
}
|
||||
20
app/Models/Promotion.php
Normal file
20
app/Models/Promotion.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Promotion extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'promotions';
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'description',
|
||||
'additional_info',
|
||||
'sort_order',
|
||||
];
|
||||
}
|
||||
22
app/Models/Size.php
Normal file
22
app/Models/Size.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Size extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'size';
|
||||
|
||||
protected $fillable = [
|
||||
'small',
|
||||
'small_photo',
|
||||
'medium',
|
||||
'medium_photo',
|
||||
'large',
|
||||
'large_photo'
|
||||
];
|
||||
}
|
||||
57
app/Models/User.php
Normal file
57
app/Models/User.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Database\Factories\UserFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Panel;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser
|
||||
{
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasFactory, Notifiable, HasRoles;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user