@Tray2 thanks for that but that's not the problem, It works well on my local server 127.0.0.1:8000/ but
doesn't work on my hosting server
my controller
public function portfolioAdd (request $request)
{
$this->validate($request, [
'img_title' => 'required|min:3',
'slug' => 'required|file|max:2024',
]);
$upload = $request->file('slug');
$path = $upload->store('public/storage/gallery');
Gallery::create([
'img_title' => $request->img_title,
'slug' => $path,
'user_id' => Auth::user()->id
]);
return redirect('/portfolio')->with('success', 'Your data is successful Added');
}
I even tried to change my filesystem but still the same error
this is my HTML file
<div class="container">
<div class="row">
<div class="portfolio-items">
@foreach($portfolio as $portfolios)
<div class="col-sm-12 col-md-6 col-lg-4">
<div class="portfolio-item">
<div class="hover-bg"> <a href="{{ Storage::url($portfolios->slug) }}" title="{{ $portfolios->img_title }}" data-lightbox-gallery="gallery1">
<div class="hover-text">
<h4>{{ $portfolios->img_title }}</h4>
</div>
<img src="{{ Storage::url($portfolios->slug) }}" class="img-responsive" alt="Project Title"> </a> </div>
</div>
</div>
@endforeach
</div>
</div>
</div>
when I try the symlink it creates this file but the file or storage it creates doesn't work
public -> /domains/mydomain.com/public_html/laravelpro/storage/app/public
my routes
Route::get('/gallery', 'GalleryController@index');
how I create my symlink
Route::get('/cache', function() {
Artisan::call('cache:clear');
});
Route::get('/storage', function() {
Artisan::call('storage:link');
});