Rework admin panel and other

This commit is contained in:
F4ilji
2025-04-02 18:37:20 +05:00
parent 49072e50c7
commit 5cd6ff11b5
198 changed files with 9715 additions and 6664 deletions
+7 -1
View File
@@ -2,10 +2,11 @@
namespace App\Models;
use App\Services\App\Seo\SeoDescriptionInterface;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AcademicJournal extends Model
class AcademicJournal extends Model implements SeoDescriptionInterface
{
use HasFactory;
@@ -27,4 +28,9 @@ class AcademicJournal extends Model
{
return $this->morphOne(Seo::class, 'seoable');
}
public function getSeoDescription(): array
{
return $this->main_info;
}
}
+1
View File
@@ -16,6 +16,7 @@ class CustomForm extends Model
'columns' => 'array',
'status' => CustomFormStatus::class,
'mail_settings' => 'array',
'settings' => 'array',
];
public function responses()
-9
View File
@@ -23,15 +23,6 @@ class Page extends Model
return $this->morphOne(Seo::class, 'seoable');
}
public function getBreadcrumbs(string $url) : array
{
$path = ltrim(parse_url(route($url), PHP_URL_PATH), '/');
$page = self::where('path', '=', $path)->with('section.pages.section', 'section.mainSection')->first();
dd($page);
}
protected $casts = [
'content' => 'array',
'settings' => 'array',
+3 -3
View File
@@ -41,14 +41,14 @@ class Post extends Model
return $this->belongsTo(User::class, 'user_id');
}
public function seo()
public function seo(): MorphOne
{
return $this->morphOne(Seo::class, 'seoable');
}
public function mainSlider()
public function slide(): MorphOne
{
return $this->morphOne(MainSlider::class, 'slidable');
return $this->morphOne(Slide::class, 'slidable');
}
protected $casts = [
+5
View File
@@ -21,4 +21,9 @@ class Slide extends Model
{
return $this->belongsTo(Slider::class);
}
public function slidable()
{
return $this->morphTo();
}
}