I have tried the following method to check if file exist:
@if(file_exists(public_path('/user_img/'.Auth::user()->id.'.jpg')))
It returns false
even when the file exists!
What is wrong with it?
I have corrected by adding curly braces to the User id
and it works fine:
@if(file_exists(public_path().'user_img/{{ Auth::User()->id }}.jpg'))