better collection handlich in backend
This commit is contained in:
parent
324eacf061
commit
50bcae442e
24 changed files with 623 additions and 68 deletions
|
@ -92,13 +92,12 @@ class HomeController extends Controller
|
|||
/**
|
||||
* show page by $page_slug.
|
||||
*/
|
||||
public function showPage($slug)
|
||||
public function showPage($slug): View
|
||||
{
|
||||
// $result = $pages->findBySlug($slug);
|
||||
if (!is_null(Page::query()->wherePage_slug($slug)->firstOrFail())) {
|
||||
$result = Page::query()->wherePage_slug($slug)->firstOrFail();
|
||||
return view('frontend.pages.index')
|
||||
->withpage($result);
|
||||
if (!is_null(Page::query()->where('page_slug', $slug)->firstOrFail())) {
|
||||
$result = Page::query()->where('page_slug', $slug)->firstOrFail();
|
||||
return view('frontend.pages.index')->withpage($result);
|
||||
} else {
|
||||
throw new GeneralException(trans('exceptions.backend.access.pages.not_found'));
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue