The problem is that I load dynamically menu pages from database. And whenever I click on the page load only page_id=1 and content... For example if I click page_id=5
will load again first result from database table. In browser address bar I see that id is changed but not on the page.
This is what I have so far.. route
Route::get ('/static/page/{pageId}', ['uses' => 'HomeController@page']);
In HomeController page looks like this
public function page() {
$pages = Pages::all();
return View::make('site.page', [
'pages' => $pages
]);
}
in page.blade.php I have this
@extends('layouts.master')
@foreach($pages as $page)
@section('title', $page->page_title)
<div class="col-xs-12">
<h3>{{ $page->page_title }}</h3>
<hr />
<div class="row">
{{ $page->page_body }}
</div>
<hr />
</div>
@endsection
@endforeach
Button which lead to page.blade
<li><a href="{{ URL::to('/static/page/'.$page->page_id) }}">{{ $page->page_title }}</a></li>