Methods Laravel

1. To use Dynamic Slug 

Route::get('{slug}', 'IndexController@blog_details');
Route::get('{slug}', 'IndexController@news_details');

Link: {{ URL::to(''.$new->slug )}}

1. Fetch first/last entry in the table

$video_news = App\News::oldest()->first();

$video_news = App\News::latest()->first();


Comments

Popular posts from this blog

Image Upload PHP Core or OOPs

Xampp Customization