diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php new file mode 100644 index 0000000..367a921 --- /dev/null +++ b/app/Http/Controllers/PageController.php @@ -0,0 +1,20 @@ +useFallbackPath(config('app.placeholder').'800.png'); } + /** + * Find page by slug. + * + * @param $slug + * @return mixed + */ + public static function findBySlug($slug) + { + return self::where('slug',$slug)->firstOrFail(); + } + /** * Scope a query to only include active pages. * diff --git a/resources/views/backend/pages/index.blade.php b/resources/views/backend/pages/index.blade.php index 5dd7730..36b8d1d 100644 --- a/resources/views/backend/pages/index.blade.php +++ b/resources/views/backend/pages/index.blade.php @@ -50,7 +50,7 @@