Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Some usefull hints for Laravel 5+
- This if collection of my small tips for Laravel.
- ## Clear some caches
- Reoptimized class loader: `php artisan optimize`
- Clear Cache facade value: `php artisan cache:clear`
- Clear Route cache: `php artisan route:cache`
- Clear View cache: `php artisan view:clear`
- Clear Config cache: `php artisan config:cache`
- ## Migrations
- If you remove migration and trying to create it (with the same name) again and catching error like
- ```
- [ErrorException]
- include(/path/vendor/composer/../../database/migrations/2017_06_14_150701_migration_name.php): failed to open stream: No such file or directory
- ```
- То просто выполните команду после удаления миграции `composer dump-autoload`!
- ## Redirect from site root to Laravel's `public` directory
- Apache (.htaccess):
- ```
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteRule ^(.*)$ public/$1 [L]
- </IfModule>
- ```
- NGINX (/etc/nginx/sites-available/project_name.conf):
- ```
- # Set root:
- root /path/to/project/public
- ```
- ```
- sudo service nginx restart
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement