Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_put_contents failed to open stream: No such file or directory #52

Open
reynoldspaul opened this issue Dec 24, 2020 · 4 comments
Open

Comments

@reynoldspaul
Copy link

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

@nexana
Copy link

nexana commented Feb 13, 2021

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?

@kaptk2
Copy link

kaptk2 commented Jun 9, 2021

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

@Yinci
Copy link

Yinci commented Jun 16, 2021

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.

@oliworx
Copy link

oliworx commented Jun 15, 2023

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.

It works for me with these lines in the boot() method of the AppServiceProvider.php
(running on Laravel Vapor)

// Create storage/app/db-blade-compiler/views directory if it doesn't exist
if (!file_exists(storage_path('app/db-blade-compiler/views'))) {
    mkdir(storage_path('app/db-blade-compiler/views'), 0777, true);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants