Answers for "laravel check if image exists in storage"

PHP
0

laravel storage check file exists

Storage::disk('public')->exists($image)
Posted by: Guest on October-17-2020
1

image exists in laravel

if(File::exists(public_path('images/1461177230.jpg'))){    dd('File is exists.');}else{    dd('File is not exists.');}
Posted by: Guest on May-08-2021
0

image exists in laravel

if(file_exists(public_path('images/1461177230.jpg'))){    dd('File is exists.');}else{    dd('File is not exists.');}
Posted by: Guest on May-08-2021
0

check image exist or not in laravel

// User Model
public function photo()
{
    if (file_exists( public_path() . '/images/photos/account/' . $this->account_id . '.png')) {
        return '/images/photos/account/' . $this->account_id .'.png';
    } else {
        return '/images/photos/account/default.png';
    }     
}

// Blade Template
<img src="{!! Auth::user()->photo() !!}" alt="">
Posted by: Guest on August-13-2021

Code answers related to "laravel check if image exists in storage"

Browse Popular Code Answers by Language