/** * Display a listing of the resource. * * @param $id * @return Response */ public function detail($id) { $sPage = 'detail'; $folio = Folio::FindOrFail($id); $link = Link::where('id_folio', $id)->get(); $ids = Folio::count(); return view('pages.detail', compact('sPage', 'folio', 'link', 'ids')); }
/* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ use App\Folio; use Illuminate\Support\Facades\App; Route::get('/', 'HomeController@index'); Route::get('/competences', 'HitController@index'); Route::get('/portfolio', 'FolioController@index'); Route::get('/portfolio/{id}', 'FolioController@detail'); Route::get('/mentions-legales', 'HomeController@motions'); Route::get('/contact', ['as' => 'contact', 'uses' => 'ContactController@index']); Route::post('/contact', ['as' => 'form_contact', 'uses' => 'ContactController@formContact']); Route::get('sitemap', function () { $sitemap = App::make("sitemap"); $sitemap->add(url('/'), '2015-12-04T11:10:00+01:00', '1.0', 'monthly'); $sitemap->add(url('/competences'), '2015-12-04T11:10:00+01:00', '0.8', 'monthly'); $sitemap->add(url('/portfolio'), '2015-12-04T11:10:00+01:00', '0.8', 'monthly'); $sitemap->add(url('/contact'), '2015-12-02T20:10:00+01:00', '0.5', 'monthly'); $folios = Folio::all()->orderBy('id', 'desc')->get(); foreach ($folios as $folio) { $sitemap->add(url('/portfolio') / $folio->id, '2015-12-04T11:10:00+01:00', '1.0', 'monthly'); } $sitemap->store('xml', 'sitemap'); });