assets
-- images/
public
-- uploads
$request->file('image');
if ($request->hasFile('image')) {
...
public function show($slug)
{
$blog = Blog::where('slug', $slug)->firstOrFail();
$category = Category::find($blog->category_id);
return view('blog.show', compact('blog'));
}
Route::get('blog/{slug}', 'BlogController@show')->name('blog.show');
@foreach ($blogs as $blog)
<a href="{{ route('blog.show', $blog->slug) }}">{{ $blog->title }}</a>
@endforeach
{{ route('blog.show', ['id' => $blog->slug]) }}