Version 1.0.0
This commit is contained in:
40
app/Models/Article.php
Normal file
40
app/Models/Article.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
class Article extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'slug', 'thumbnail', 'body', 'active', 'published_at', 'user_id', 'type', 'category_id', 'external', 'additional_body', 'map_body'];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function categories(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Category::class, 'category_article')
|
||||
->using(CategoryArticle::class)
|
||||
->withPivot('sort_order');
|
||||
}
|
||||
|
||||
public function navigationItems(): MorphMany
|
||||
{
|
||||
return $this->morphMany(NavigationItem::class, 'navigable');
|
||||
}
|
||||
|
||||
public function attachments(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Attachment::class, 'article_attachment');
|
||||
}
|
||||
|
||||
public function photos(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Photo::class, 'article_photo');
|
||||
}
|
||||
}
|
||||
19
app/Models/ArticleAttachment.php
Normal file
19
app/Models/ArticleAttachment.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class ArticleAttachment extends Model
|
||||
{
|
||||
protected $table = 'article_attachment';
|
||||
|
||||
protected $fillable = [
|
||||
'article_id',
|
||||
'attachment_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
|
||||
}
|
||||
37
app/Models/ArticleNews.php
Normal file
37
app/Models/ArticleNews.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class ArticleNews extends Model
|
||||
{
|
||||
protected $table = 'article_news';
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'thumbnail',
|
||||
'body',
|
||||
'active',
|
||||
'published_at',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
public function attachments(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Attachment::class, 'article_news_attachment');
|
||||
}
|
||||
|
||||
public function photos(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Photo::class, 'article_news_photo');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
18
app/Models/ArticleNewsAttachment.php
Normal file
18
app/Models/ArticleNewsAttachment.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class ArticleNewsAttachment extends Model
|
||||
{
|
||||
protected $table = 'article_news_attachment';
|
||||
|
||||
protected $fillable = [
|
||||
'article_news_id',
|
||||
'attachment_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
18
app/Models/ArticleNewsPhoto.php
Normal file
18
app/Models/ArticleNewsPhoto.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticleNewsPhoto extends Model
|
||||
{
|
||||
protected $table = 'article_news_photo';
|
||||
|
||||
protected $fillable = [
|
||||
'article_news_id',
|
||||
'photo_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
18
app/Models/ArticlePhoto.php
Normal file
18
app/Models/ArticlePhoto.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticlePhoto extends Model
|
||||
{
|
||||
protected $table = 'article_photo';
|
||||
|
||||
protected $fillable = [
|
||||
'article_id',
|
||||
'photo_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
31
app/Models/Attachment.php
Normal file
31
app/Models/Attachment.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Attachment extends Model
|
||||
{
|
||||
protected $fillable = ['file_name', 'file_path'];
|
||||
|
||||
public function articles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Article::class, 'article_attachment');
|
||||
}
|
||||
|
||||
public function articlesNews(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ArticleNews::class, 'article_news_attachment');
|
||||
}
|
||||
|
||||
public function jobOffers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(JobOffers::class, 'job_offers_attachment');
|
||||
}
|
||||
|
||||
public function projectArticles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ProjectArticle::class, 'project_article_attachment');
|
||||
}
|
||||
}
|
||||
25
app/Models/Category.php
Normal file
25
app/Models/Category.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'slug'];
|
||||
|
||||
public function articles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Article::class, 'category_article')
|
||||
->using(CategoryArticle::class)
|
||||
->withPivot('sort_order')
|
||||
->orderBy('category_article.sort_order');
|
||||
}
|
||||
|
||||
public function navigationItems(): MorphMany
|
||||
{
|
||||
return $this->morphMany(NavigationItem::class, 'navigable');
|
||||
}
|
||||
}
|
||||
22
app/Models/CategoryArticle.php
Normal file
22
app/Models/CategoryArticle.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class CategoryArticle extends Pivot
|
||||
{
|
||||
protected $table = 'category_article';
|
||||
|
||||
protected $fillable = [
|
||||
'category_id',
|
||||
'article_id',
|
||||
'sort_order',
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
10
app/Models/Contact.php
Normal file
10
app/Models/Contact.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
protected $fillable = ['system_email', 'telephone', 'email', 'address', 'fax'];
|
||||
}
|
||||
25
app/Models/Diet.php
Normal file
25
app/Models/Diet.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class Diet extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'breakfast_photo',
|
||||
'lunch_photo',
|
||||
'breakfast_body',
|
||||
'lunch_body',
|
||||
'active',
|
||||
'published_at',
|
||||
'user_id',
|
||||
'diet_attachment',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
14
app/Models/Employee.php
Normal file
14
app/Models/Employee.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Employee extends Model
|
||||
{
|
||||
protected $fillable = ['sort_order', 'section', 'employees', 'slug'];
|
||||
|
||||
protected $casts = [
|
||||
'employees' => 'array',
|
||||
];
|
||||
}
|
||||
15
app/Models/Footer.php
Normal file
15
app/Models/Footer.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Footer extends Model
|
||||
{
|
||||
protected $fillable = ['wosp_link', 'links', 'registration_hours'];
|
||||
|
||||
protected $casts = [
|
||||
'links' => 'array',
|
||||
'registration_hours' => 'array',
|
||||
];
|
||||
}
|
||||
14
app/Models/Header.php
Normal file
14
app/Models/Header.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Header extends Model
|
||||
{
|
||||
protected $fillable = ['telephone', 'links', 'logo', 'title1', 'title2', 'subtitle'];
|
||||
|
||||
protected $casts = [
|
||||
'links' => 'array',
|
||||
];
|
||||
}
|
||||
14
app/Models/Homepage.php
Normal file
14
app/Models/Homepage.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Homepage extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'photo', 'content', 'carousel_photos'];
|
||||
|
||||
protected $casts = [
|
||||
'carousel_photos' => 'array',
|
||||
];
|
||||
}
|
||||
36
app/Models/JobOffers.php
Normal file
36
app/Models/JobOffers.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class JobOffers extends Model
|
||||
{
|
||||
protected $table = 'job_offers';
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'body',
|
||||
'active',
|
||||
'published_at',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
public function attachments(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Attachment::class, 'job_offers_attachment');
|
||||
}
|
||||
|
||||
public function photos(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Photo::class, 'job_offers_photo');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
18
app/Models/JobOffersAttachment.php
Normal file
18
app/Models/JobOffersAttachment.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class JobOffersAttachment extends Model
|
||||
{
|
||||
protected $table = 'job_offers_attachment';
|
||||
|
||||
protected $fillable = [
|
||||
'job_offers_id',
|
||||
'attachment_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
18
app/Models/JobOffersPhoto.php
Normal file
18
app/Models/JobOffersPhoto.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class JobOffersPhoto extends Model
|
||||
{
|
||||
protected $table = 'job_offers_photo';
|
||||
|
||||
protected $fillable = [
|
||||
'job_offers_id',
|
||||
'photo_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
10
app/Models/Location.php
Normal file
10
app/Models/Location.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
protected $fillable = ['photo_id'];
|
||||
}
|
||||
15
app/Models/NavigationItem.php
Normal file
15
app/Models/NavigationItem.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class NavigationItem extends Model
|
||||
{
|
||||
protected $fillable = ['name', 'sort_order', 'navigable_type', 'navigable_id'];
|
||||
|
||||
public function navigable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
31
app/Models/Photo.php
Normal file
31
app/Models/Photo.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Photo extends Model
|
||||
{
|
||||
protected $fillable = ['image_name', 'image_desc', 'image_path'];
|
||||
|
||||
public function articles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Article::class, 'article_photo');
|
||||
}
|
||||
|
||||
public function articlesNews(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ArticleNews::class, 'article_news_photo');
|
||||
}
|
||||
|
||||
public function jobOffers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(JobOffers::class, 'job_offers_photo');
|
||||
}
|
||||
|
||||
public function projectArticles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ProjectArticle::class, 'project_article_photo');
|
||||
}
|
||||
}
|
||||
11
app/Models/Price.php
Normal file
11
app/Models/Price.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class Price extends Model
|
||||
{
|
||||
protected $fillable = ['attachment_id'];
|
||||
}
|
||||
33
app/Models/ProjectArticle.php
Normal file
33
app/Models/ProjectArticle.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class ProjectArticle extends Model
|
||||
{
|
||||
protected $table = 'project_articles';
|
||||
protected $fillable = ['title', 'slug', 'logo', 'body', 'active', 'published_at', 'user_id', 'project_type_id'];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function projectTypes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ProjectType::class, 'project_type_project_article');
|
||||
}
|
||||
|
||||
public function attachments(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Attachment::class, 'project_article_attachment');
|
||||
}
|
||||
|
||||
public function photos(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Photo::class, 'project_article_photo');
|
||||
}
|
||||
}
|
||||
18
app/Models/ProjectArticleAttachment.php
Normal file
18
app/Models/ProjectArticleAttachment.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class ProjectArticleAttachment extends Model
|
||||
{
|
||||
protected $table = 'project_article_attachment';
|
||||
|
||||
protected $fillable = [
|
||||
'project_article_id',
|
||||
'attachment_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
18
app/Models/ProjectArticlePhoto.php
Normal file
18
app/Models/ProjectArticlePhoto.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class ProjectArticlePhoto extends Model
|
||||
{
|
||||
protected $table = 'project_article_photo';
|
||||
|
||||
protected $fillable = [
|
||||
'project_article_id',
|
||||
'photo_id',
|
||||
];
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
17
app/Models/ProjectType.php
Normal file
17
app/Models/ProjectType.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class ProjectType extends Model
|
||||
{
|
||||
protected $table = 'project_types';
|
||||
protected $fillable = ['title', 'slug'];
|
||||
|
||||
public function projectArticles(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ProjectArticle::class, 'project_type_project_article');
|
||||
}
|
||||
}
|
||||
21
app/Models/ProjectTypeProjectArticle.php
Normal file
21
app/Models/ProjectTypeProjectArticle.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class ProjectTypeProjectArticle extends Pivot
|
||||
{
|
||||
protected $table = 'project_type_project_article';
|
||||
|
||||
protected $fillable = [
|
||||
'project_type_id',
|
||||
'project_article_id'
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
use HasFactory;
|
||||
}
|
||||
14
app/Models/Telephone.php
Normal file
14
app/Models/Telephone.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Telephone extends Model
|
||||
{
|
||||
protected $fillable = ['sort_order', 'section', 'telephones'];
|
||||
|
||||
protected $casts = [
|
||||
'telephones' => 'array',
|
||||
];
|
||||
}
|
||||
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 Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Panel;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\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