Rework admin panel and other
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class CustomForm extends Model
|
||||
'columns' => 'array',
|
||||
'status' => CustomFormStatus::class,
|
||||
'mail_settings' => 'array',
|
||||
'settings' => 'array',
|
||||
];
|
||||
|
||||
public function responses()
|
||||
|
||||
@@ -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
@@ -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 = [
|
||||
|
||||
@@ -21,4 +21,9 @@ class Slide extends Model
|
||||
{
|
||||
return $this->belongsTo(Slider::class);
|
||||
}
|
||||
|
||||
public function slidable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user