[{"data":1,"prerenderedAt":293},["Reactive",2],{"content-query-ygIx6unirf":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"head":10,"layout":12,"body":13,"_type":288,"_id":289,"_source":290,"_file":291,"_extension":292},"/docs/laravel/laravel-automations","laravel",false,"","Laravel Automations","Automate your deployments and minimize your efforts with Laravel.",{"title":11},"Laravel Automations Script - Docker PHP - Server Side Up","docs",{"type":14,"children":15,"toc":276},"root",[16,24,45,77,84,89,96,101,135,143,158,164,184,190,203,213,219,224,234,240,245,255,261,266],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"laravel-automations",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28,35,37,43],{"type":17,"tag":29,"props":30,"children":32},"code",{"className":31},[],[33],{"type":23,"value":34},"serversideup/php",{"type":23,"value":36}," has a \"Laravel Automations\" script that helps you automate certain steps during your deployments. By default, the script is ",{"type":17,"tag":38,"props":39,"children":40},"strong",{},[41],{"type":23,"value":42},"DISABLED",{"type":23,"value":44},". We only recommend enabling this script in production environments.",{"type":17,"tag":46,"props":47,"children":48},"note",{},[49],{"type":17,"tag":25,"props":50,"children":51},{},[52,58,60,66,68,75],{"type":17,"tag":29,"props":53,"children":55},{"className":54},[],[56],{"type":23,"value":57},"AUTORUN_ENABLED",{"type":23,"value":59}," must be set to ",{"type":17,"tag":29,"props":61,"children":63},{"className":62},[],[64],{"type":23,"value":65},"true",{"type":23,"value":67}," to enable the script. See our ",{"type":17,"tag":69,"props":70,"children":72},"a",{"href":71},"/docs/reference/environment-variable-specification",[73],{"type":23,"value":74},"variable reference document",{"type":23,"value":76}," for more details.",{"type":17,"tag":78,"props":79,"children":81},"h2",{"id":80},"what-the-script-does",[82],{"type":23,"value":83},"What the script does",{"type":17,"tag":25,"props":85,"children":86},{},[87],{"type":23,"value":88},"This script executes on container start up and performs the following tasks:",{"type":17,"tag":90,"props":91,"children":93},"h3",{"id":92},"php-artisan-migrate",[94],{"type":23,"value":95},"php artisan migrate",{"type":17,"tag":25,"props":97,"children":98},{},[99],{"type":23,"value":100},"Before running migrations, we ensure the database is online and ready to accept connections. By default, we will wait 30 seconds before timing out.",{"type":17,"tag":25,"props":102,"children":103},{},[104,106,118,120,126,128,133],{"type":23,"value":105},"You can enable the ",{"type":17,"tag":69,"props":107,"children":111},{"href":108,"rel":109},"https://laravel.com/docs/11.x/migrations#running-migrations",[110],"nofollow",[112],{"type":17,"tag":29,"props":113,"children":115},{"className":114},[],[116],{"type":23,"value":117},"--isolated",{"type":23,"value":119}," flag by setting ",{"type":17,"tag":29,"props":121,"children":123},{"className":122},[],[124],{"type":23,"value":125},"AUTORUN_LARAVEL_MIGRATION_ISOLATION",{"type":23,"value":127}," to ",{"type":17,"tag":29,"props":129,"children":131},{"className":130},[],[132],{"type":23,"value":65},{"type":23,"value":134},", which will ensure no other containers are running a migration.",{"type":17,"tag":25,"props":136,"children":137},{},[138],{"type":17,"tag":38,"props":139,"children":140},{},[141],{"type":23,"value":142},"Special Notes for Isolated Migrations:",{"type":17,"tag":144,"props":145,"children":146},"ul",{},[147,153],{"type":17,"tag":148,"props":149,"children":150},"li",{},[151],{"type":23,"value":152},"Requires Laravel v9.38.0+",{"type":17,"tag":148,"props":154,"children":155},{},[156],{"type":23,"value":157},"Your database must support database locks (meaning SQLite is not supported)",{"type":17,"tag":90,"props":159,"children":161},{"id":160},"php-artisan-storagelink",[162],{"type":23,"value":163},"php artisan storage:link",{"type":17,"tag":25,"props":165,"children":166},{},[167,169,175,176,182],{"type":23,"value":168},"This command creates a symbolic link from ",{"type":17,"tag":29,"props":170,"children":172},{"className":171},[],[173],{"type":23,"value":174},"public/storage",{"type":23,"value":127},{"type":17,"tag":29,"props":177,"children":179},{"className":178},[],[180],{"type":23,"value":181},"storage/app/public",{"type":23,"value":183},".",{"type":17,"tag":90,"props":185,"children":187},{"id":186},"php-artisan-configcache",[188],{"type":23,"value":189},"php artisan config:cache",{"type":17,"tag":25,"props":191,"children":192},{},[193,195,201],{"type":23,"value":194},"This command caches all configuration files into a single file, which can then be quickly loaded by Laravel. Once the configuration is cache, the ",{"type":17,"tag":29,"props":196,"children":198},{"className":197},[],[199],{"type":23,"value":200},".env",{"type":23,"value":202}," file will no longer be loaded.",{"type":17,"tag":25,"props":204,"children":205},{},[206],{"type":17,"tag":69,"props":207,"children":210},{"href":208,"rel":209},"https://laravel.com/docs/11.x/configuration#configuration-caching",[110],[211],{"type":23,"value":212},"Read more about configuration caching →",{"type":17,"tag":90,"props":214,"children":216},{"id":215},"php-artisan-routecache",[217],{"type":23,"value":218},"php artisan route:cache",{"type":17,"tag":25,"props":220,"children":221},{},[222],{"type":23,"value":223},"This command caches the routes, dramatically decrease the time it takes to register all of your application's routes. After running this command, your cached routes file will be loaded on every request.",{"type":17,"tag":25,"props":225,"children":226},{},[227],{"type":17,"tag":69,"props":228,"children":231},{"href":229,"rel":230},"https://laravel.com/docs/11.x/routing#route-caching",[110],[232],{"type":23,"value":233},"Read more about route caching →",{"type":17,"tag":90,"props":235,"children":237},{"id":236},"php-artisan-viewcache",[238],{"type":23,"value":239},"php artisan view:cache",{"type":17,"tag":25,"props":241,"children":242},{},[243],{"type":23,"value":244},"This command caches all of the views in your application, which can greatly decrease the time it takes to render your views.",{"type":17,"tag":25,"props":246,"children":247},{},[248],{"type":17,"tag":69,"props":249,"children":252},{"href":250,"rel":251},"https://laravel.com/docs/11.x/views#optimizing-views",[110],[253],{"type":23,"value":254},"Read more about view caching →",{"type":17,"tag":90,"props":256,"children":258},{"id":257},"php-artisan-eventcache",[259],{"type":23,"value":260},"php artisan event:cache",{"type":17,"tag":25,"props":262,"children":263},{},[264],{"type":23,"value":265},"This command creates a manifest of all your application's events and listeners, which can greatly speed up the process of registering them with Laravel.",{"type":17,"tag":25,"props":267,"children":268},{},[269],{"type":17,"tag":69,"props":270,"children":273},{"href":271,"rel":272},"https://laravel.com/docs/11.x/events#event-discovery-in-production",[110],[274],{"type":23,"value":275},"Read more about event caching →",{"title":7,"searchDepth":277,"depth":277,"links":278},2,[279],{"id":80,"depth":277,"text":83,"children":280},[281,283,284,285,286,287],{"id":92,"depth":282,"text":95},3,{"id":160,"depth":282,"text":163},{"id":186,"depth":282,"text":189},{"id":215,"depth":282,"text":218},{"id":236,"depth":282,"text":239},{"id":257,"depth":282,"text":260},"markdown","content:docs:4.laravel:1.laravel-automations.md","content","docs/4.laravel/1.laravel-automations.md","md",1727889281230]