Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. # Some usefull hints for Laravel 5+
  2. This if collection of my small tips for Laravel.
  3.  
  4. ## Clear some caches
  5. Reoptimized class loader: `php artisan optimize`
  6.  
  7. Clear Cache facade value: `php artisan cache:clear`
  8.  
  9. Clear Route cache: `php artisan route:cache`
  10.  
  11. Clear View cache: `php artisan view:clear`
  12.  
  13. Clear Config cache: `php artisan config:cache`
  14.  
  15. ## Migrations
  16. If you remove migration and trying to create it (with the same name) again and catching error like
  17. ```
  18. [ErrorException]
  19. include(/path/vendor/composer/../../database/migrations/2017_06_14_150701_migration_name.php): failed to open stream: No such file or directory
  20. ```
  21.  
  22. То просто выполните команду после удаления миграции `composer dump-autoload`!
  23.  
  24. ## Redirect from site root to Laravel's `public` directory
  25. Apache (.htaccess):
  26. ```
  27. <IfModule mod_rewrite.c>
  28. RewriteEngine On
  29.  
  30. RewriteRule ^(.*)$ public/$1 [L]
  31. </IfModule>
  32. ```
  33.  
  34. NGINX (/etc/nginx/sites-available/project_name.conf):
  35. ```
  36. # Set root:
  37. root /path/to/project/public
  38. ```
  39.  
  40. ```
  41. sudo service nginx restart
  42. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement