laravel-db-blade-compiler icon indicating copy to clipboard operation
laravel-db-blade-compiler copied to clipboard

file_put_contents failed to open stream: No such file or directory

Open reynoldspaul opened this issue 4 years ago • 4 comments

Hi, after installation, and running:

DbView::make($this)->field('email_subject')->with($data)->render();

I get the following error

file_put_contents(../app/db-blade-compiler/views/b92b4b7d77cc4fdc95e46a0d6e471b5e): 
failed to open stream: No such file or directory

I can fix this by manually creating the folder /app/db-blade-compiler/views. I have cache set to false in config

Using Laravel 8,0, latest version of this package

reynoldspaul avatar Dec 24 '20 13:12 reynoldspaul

Encountered the same issue numerous times with different combinations of the compiler (and laravel). Maybe it would be nice to have the compiled directory as a config parameter?

nexana avatar Feb 13 '21 07:02 nexana

Or another option would be to make sure the directory exists and if it doesn't create it.

kaptk2 avatar Jun 09 '21 19:06 kaptk2

I ran into the same issue. I just have this set above:

if (! Storage::exists('db-blade-compiler/views')) {
    Storage::makeDirectory('db-blade-compiler/views');
}

However, I shouldn't have to do this. It's weird that it doesn't even check within the package itself.

Yinci avatar Jun 16 '21 07:06 Yinci