<img src="{{ asset($item->image) }}">
or
<img src="{{ asset('/public/upload/image.jpg') }}">
<img src="{{URL::asset('/image/propic.png')}}" alt="profile Pic" height="200" width="200">
<img src="{{ url('') }}/public/images/{{$result->image }}">
or
<img src="{{url('/public/images/')}}/{{$result->image }}">
<img src="{{ asset('img/' . $post->image) }}" />
<img src="{{asset($item->image)}}" width="100" height="100">
<img src="{{ url('') }}/public/images/post_images/{{$result->post_img }}">
or
<img src="{{url('/public/images/post_images/')}}/{{$result->post_img }}">
$fileName = $file->storePublicly('images/media', [
'disk' => 's3'
]);
$fileName = $file->storePublicly('images/media', [
'disk' => 's3'
]);
#image
<?php
namespace AppTraits;
use IlluminateSupportStr;
use IlluminateHttpUploadedFile;
use IlluminateSupportFacadesStorage;
trait Upload
{
public function UploadFile(UploadedFile $file, $folder = null, $disk = 'public', $filename = null)
{
$FileName = !is_null($filename) ? $filename : Str::random(10);
return $file->storeAs(
$folder,
$FileName . "." . $file->getClientOriginalExtension(),
$disk
);
}
public function deleteFile($path, $disk = 'public')
{
Storage::disk($disk)->delete($path);
}
}