Skip to content

Conversation

nastoychev
Copy link
Contributor

We add the two values, visibility and throw, in Laravel's filesystem configuration for the following reasons:

  1. visibility => 'public': Ensures that files and directories created are accessible to the web server (e.g., Nginx). Files will have permissions like 644 and directories 755, making them readable by others while maintaining write permissions for the application.

  2. throw => false: Prevents Laravel from throwing exceptions when a filesystem operation (like file upload or deletion) fails. Instead, Laravel will silently fail, allowing you to handle errors gracefully without crashing the application.

These settings help ensure compatibility between containers (Nginx and PHP-FPM) and avoid permission-related issues during file access.

We add the two values, **`visibility`** and **`throw`**, in Laravel's filesystem configuration for the following reasons:

1. **`visibility` => 'public'**:  
   Ensures that files and directories created are accessible to the web server (e.g., Nginx). Files will have permissions like **`644`** and directories **`755`**, making them readable by others while maintaining write permissions for the application.

2. **`throw` => false**:  
   Prevents Laravel from throwing exceptions when a filesystem operation (like file upload or deletion) fails. Instead, Laravel will silently fail, allowing you to handle errors gracefully without crashing the application.

These settings help ensure compatibility between containers (Nginx and PHP-FPM) and avoid permission-related issues during file access.
@freekmurze freekmurze merged commit a352432 into spatie:main Dec 16, 2024
1 check passed
@freekmurze
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants