composer install
composer dump-autoload
composer update
Database Schema Generation
php artisan serve --port=8020
php artisan migrate
php artisan migrate --seed
php artisan migrate:refresh
php artisan migrate:refresh --seed
php artisan serve --port=8020 --host=0.0.0.0
When quizzes
table is deleted :
php artisan make:migration create_quizzes_table
php artisan migrate
- To Double Check :
- Migration Status: You can check the status of your migrations using the command:
- Rollback & Re-migrate: If needed, you can rollback the last batch of migrations (which will drop the tables) and then re-run them.
php artisan migrate:status
php artisan migrate:rollback
composer require barryvdh/laravel-ide-helper
https://stackoverflow.com/questions/68515548/phpstorm-says-find-method-not-found
https://techvblogs.com/blog/laravel-10-crud-example-tutorial-for-beginners
To ensure that files uploaded through your application have the correct permissions, you need to configure your Laravel application to set the appropriate permissions when saving files. Additionally, resolving the CORS issue is crucial.
Step 1: Ensure Correct File Permissions on Upload
You can set the file permissions when saving files in Laravel. Here’s how you can do it:
Open your file upload logic:
If you have a controller or service handling file uploads, you can set the permissions there. For example:
Example in Controller:
Step 2: Fix CORS Issue
Ensure the
fruitcake/laravel-cors
package is correctly configured and headers are set properly.Install the package:
Publish the configuration:
php artisan vendor:publish --provider="Fruitcake\Cors\CorsServiceProvider"
Configure
config/cors.php
:Ensure the middleware is registered in
app/Http/Kernel.php
:Clear configuration cache:
Step 3: Verify Web Server Configuration
Ensure that your web server is configured to allow CORS headers:
For Nginx:
Add the following in your server block:
For Apache:
Add this in your
.htaccess
file:Step 4: Test the Configuration
After making these changes, upload a new file through your application and verify that:
By following these steps, you should be able to ensure that files uploaded through your application have the correct permissions and are accessible from your frontend app without CORS issues.