S
S
sutkin main2015-12-16 13:43:20
Laravel
sutkin main, 2015-12-16 13:43:20

Laravel make website page template?

Hello! before that he worked mainly on cms WP, now he moved to laravel. So WP has such a thing as SinglePage, that is, if you need to make another page on the site with the same structure as on SinglePage, then you can use it as much as you want.
Like for example read more and there is essentially the same page with different content.
Now the question is, how can I implement such a page in laravel, since I already did it, but not very successfully (
here is the code:

get('education/{slug}', [
    'as' => 'educations',
    'uses' => '[email protected]'
]);

controller:
public function getBeginEd($slug){
        $beggins = Info::where('link', '=', $slug)->get();
        
        return view('education', [
            'educated' => $beggins
        ]);
}

Then I call it in the view, it only gives an error because it is in the menu and immediately gives an error (( How can I do it right in Laravel, can anyone tell me? I will be grateful route('educations', $educated->slug)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2015-12-16
@miraage

Try like this
Info::where('link', $slug)->firstOrFail();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question