public function index() { $years = Year::orderBy('year', 'desc')->get(); return view('backends.admins.year-index')->with('years', $years); }
<i class="dropdown icon"></i> <div class="menu"> <?php $amphurs = \App\Models\Thailand\Amphur::where("province_id", "=", "44")->get(); ?> @foreach($amphurs as $amphur) <a class="link item" href="/amphur/{{$amphur->AMPHUR_ID}}/{{$amphur->AMPHUR_NAME}}">{{$amphur->AMPHUR_NAME}}</a> @endforeach </div> </div> <div class="ui simple dropdown item"> ปีที่ดำเนินโครงการ <i class="dropdown icon"></i> <div class="menu"> <?php $years = \App\Models\Year::orderBy('year', 'desc')->get(); ?> @foreach($years as $year) <a class="link item" href="/project?year={{$year->year}}">{{$year->year}}</a> @endforeach </div> </div> </div> <div class="sixteen wide column"> @yield('content')