Good morning I have a problem of routes, in localhost it works perfect but when uploading it to the hosting it gives me error for example I have tried to change 'public/images/'
for asset('images/')
or for 'images/'
or for 'public_html/images/'
but nothing. .. Does someone have any idea of what it can be ?? by the way I've uploaded to a hosting that the public folder is called public_html
Driver with routes
if($file) {
$post = Post::create($request->all());
//get filename with extension
$filenamewithextension = $file->getClientOriginalName();
//get filename without extension
$filename = pathinfo($filenamewithextension, PATHINFO_FILENAME);
//get file extension
$extension = $file->getClientOriginalExtension();
//filename to store
$filenametostore = $request->user_id.'-'.$filename.'_'.time().'.'.$extension;
$post->fill(['file' => $filenametostore])->save();
$ori = 'public/images/'."$request->di";
$mini = 'public/images/mini/'."$request->di";
$minin = 'public/images/minin/'."$request->di";
//Upload File
$file->storeAs($ori, $filenametostore);
$file->storeAs($mini, $filenametostore);
$file->storeAs($minin, $filenametostore);
$tmini = 'storage/images/mini/'."$request->di".'/';
$tminin = 'storage/images/minin/'."$request->di".'/';
//Resize image
$thumbnailpath = public_path("$tmini"."$filenametostore");
$img = Image::make($thumbnailpath)->resize(null, 200, function($constraint) {
$constraint->aspectRatio();
});
$img->save($thumbnailpath);
//Resize image perfil
$thumbnailpat = public_path("$tminin"."$filenametostore");
$imgn = Image::make($thumbnailpat)->resize(null, 200, function($constraint) {
$constraint->aspectRatio();
})->resizeCanvas(200, 200 );
$imgn->save($thumbnailpat);
}
Are both the 'public/images/'
and the 'storage/images/mini/'