<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: massimo colella</title>
    <description>The latest articles on DEV Community by massimo colella (@massimocolella).</description>
    <link>https://dev.to/massimocolella</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F836761%2F1f84f317-4717-4113-84a7-1461daa5f0f8.jpg</url>
      <title>DEV Community: massimo colella</title>
      <link>https://dev.to/massimocolella</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/massimocolella"/>
    <language>en</language>
    <item>
      <title>configure Plesk and Gitlab to deploy your laravel application</title>
      <dc:creator>massimo colella</dc:creator>
      <pubDate>Fri, 27 May 2022 09:59:00 +0000</pubDate>
      <link>https://dev.to/massimocolella/configure-plesk-and-gitlab-to-deploy-your-laravel-application-1gh0</link>
      <guid>https://dev.to/massimocolella/configure-plesk-and-gitlab-to-deploy-your-laravel-application-1gh0</guid>
      <description>&lt;p&gt;Assuming you have your project repository in Gitlab, and a Plesk hosting interface to work with, follow these steps to create a CI/CD between your gitlab repository and your hosting panel, and publishing automagically your laravel application.&lt;br&gt;
Before you begin, some details: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If not available, ask your hosting provider to install the GIT Plesk extension. It's free and it's mandatory, to make this CI/CD work.&lt;/li&gt;
&lt;li&gt;Plesk has a default webroot public folder for your website, called '&lt;strong&gt;httpdocs&lt;/strong&gt;'. We will instead use the default laravel '&lt;strong&gt;public&lt;/strong&gt;' folder. So, enter your plesk admin panel, and click the Hosting Settings link. Change the value in the interface, as you see in this screenshot:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Uq2vPdBK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9e4z73cebw9eq5htp5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Uq2vPdBK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e9e4z73cebw9eq5htp5x.png" alt="Plesk admin interface" width="880" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your project subscription in Plesk;&lt;/li&gt;
&lt;li&gt;Click the GIT icon (if not installed, proceed to install the GIT extension, or ask your hosting provider to do so)&lt;/li&gt;
&lt;li&gt;Click to Add Repository&lt;/li&gt;
&lt;li&gt;Enter the &lt;strong&gt;gitlab ssh&lt;/strong&gt; or the &lt;strong&gt;https address&lt;/strong&gt; in the repository URL&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C_xsOMSM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr2ce2427yagst306bpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C_xsOMSM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr2ce2427yagst306bpa.png" alt="Plesk - Git extension interface" width="880" height="1005"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Plesk will generate a &lt;strong&gt;ssh public key&lt;/strong&gt;, maybe it will be already automatically copied in your clipboard. Copy it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your gitlab project, then go to &lt;strong&gt;settings -&amp;gt; repository&lt;/strong&gt;, then click the &lt;strong&gt;Expand button&lt;/strong&gt; of the '&lt;strong&gt;Deploy Keys&lt;/strong&gt;' section.&lt;/li&gt;
&lt;li&gt;Insert a name for your key, then paste the copied key in the field below. Check the '&lt;strong&gt;Grant write permission to this key&lt;/strong&gt;' option, then click the '&lt;strong&gt;add key&lt;/strong&gt;' button below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LHzXzRlW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u2xm6fu5k96yx7fht3b0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LHzXzRlW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u2xm6fu5k96yx7fht3b0.png" alt="Gitlab settings" width="880" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Return to your plesk interface, then click again the Git icon.
You will find a panel like this one below:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QyFOHvt6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2p620re2u937reepug4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QyFOHvt6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2p620re2u937reepug4b.png" alt="Plesk - git settings" width="880" height="931"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;here you can change which branch will be published on your web server. Choose the one you need.&lt;br&gt;
Next, we will change the default deployment location. Click the settings icon in the lower right corner of the panel, then change the &lt;strong&gt;Server Path&lt;/strong&gt; leaving a simple slash /, removing the default folder, 'httpdocs'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fbbkZMZu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2hanvi5adbvbpdu0l8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fbbkZMZu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2hanvi5adbvbpdu0l8d.png" alt="Plesk - Git settings" width="880" height="1336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;click the &lt;strong&gt;Deploy now&lt;/strong&gt; button to pull the git files onto the web server root.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Finally, you will need to make your laravel application work within your plesk hosting, running composer and npm. &lt;a href="https://dev.to/massimocolella/step-by-step-guide-to-publish-you-laravel-project-on-a-shared-hosting-with-parallel-plesk-4p43"&gt;Refer to this article&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Step by step guide to host your Laravel project on Plesk</title>
      <dc:creator>massimo colella</dc:creator>
      <pubDate>Fri, 25 Mar 2022 22:49:31 +0000</pubDate>
      <link>https://dev.to/massimocolella/step-by-step-guide-to-publish-you-laravel-project-on-a-shared-hosting-with-parallel-plesk-4p43</link>
      <guid>https://dev.to/massimocolella/step-by-step-guide-to-publish-you-laravel-project-on-a-shared-hosting-with-parallel-plesk-4p43</guid>
      <description>&lt;p&gt;My goal is to create a guide for those who have a shared infrastructure and do not have access to cloud computing.&lt;br&gt;
This tutorial expects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An account on a shared hosting, within a Linux Plesk webserver&lt;/li&gt;
&lt;li&gt;Your Laravel application, ready to be published&lt;/li&gt;
&lt;li&gt;You are confident with the Plesk control panel&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Put your code on&lt;/li&gt;
&lt;li&gt;Configure the hosting&lt;/li&gt;
&lt;li&gt;Composer install everything&lt;/li&gt;
&lt;li&gt;Compile with Node.js&lt;/li&gt;
&lt;li&gt;Using Artisan commands&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Put your code on &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;There are two methods available to publish your code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uploading your code with an FTP/SFTP/FTPS account&lt;/li&gt;
&lt;li&gt;publishing through a github repository&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Using S/FTP/S
&lt;/h3&gt;

&lt;p&gt;When you setup a subscription on a Plesk environment, this is your initial file system:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8axskv9lkxfgtca3os0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8axskv9lkxfgtca3os0d.png" alt="Plesk File system"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This step depends on the permissions your user has been granted:&lt;/p&gt;

&lt;p&gt;If you have full rights, delete the httpdocs and the error_docs folders, then upload your code just inside the “&lt;strong&gt;Home directory&lt;/strong&gt;”, on the main root level.&lt;/p&gt;

&lt;p&gt;If you do not have the permissions to delete the original folders, you can work just inside the “&lt;strong&gt;httpdocs&lt;/strong&gt;” folder. Publish your code into the httpdocs folder, then you will set the "/httpdocs/public/" folder as your Document root.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Remember skipping the upload of the local “&lt;strong&gt;vendor&lt;/strong&gt;” and “&lt;strong&gt;node_modules&lt;/strong&gt;” folders, as these will be recreated dynamically on Plesk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using a git repo
&lt;/h3&gt;

&lt;p&gt;Please refer to &lt;strong&gt;this great article&lt;/strong&gt; by Michael Lohr:&lt;br&gt;
&lt;a href="https://dev.to/michidk/automatically-deploy-websites-to-plesk-using-github-actions-or-gitlab-ci-56gj"&gt;https://dev.to/michidk/automatically-deploy-websites-to-plesk-using-github-actions-or-gitlab-ci-56gj&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure the hosting &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The web root of your project is initially setup on “&lt;strong&gt;httpdocs&lt;/strong&gt;”. We will change that, matching the Laravel requirements.&lt;br&gt;
Open your Plesk subscription panel, then go to “&lt;strong&gt;Hosting settings&lt;/strong&gt;”. Change the “&lt;strong&gt;Document root&lt;/strong&gt;” value to match the Laravel “public” folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2y9teq46zj793mfp3qf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2y9teq46zj793mfp3qf.png" alt="Plesk Hosting settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Composer install everything &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Click the “&lt;strong&gt;PHP Composer&lt;/strong&gt;” icon on the control panel, then the “&lt;strong&gt;Scan&lt;/strong&gt;” button, to load the details of your project. Plesk will find your Laravel composer.json file and scan it for the packages to install.&lt;br&gt;
If you have a very small project, you do not have to do more than “installing” the dependencies, by clicking the right button. Else, you will need more memory so, if your hosting provider enables it, click the "Environment variables" in the Composer control panel &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdvlktj1r496feh42llcf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdvlktj1r496feh42llcf.png" alt="Plesk Composer settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and specify one of these two environment variables with settings like these (for example, 4Gb memory):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;memory_limit = 4G&lt;br&gt;
COMPOSER_MEMORY_LIMIT = 4G&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
If composer does not get enough memory to complete its jobs, you can use unlimited memory limit (if your hosting provider gives you grants):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;memory_limit = -1&lt;br&gt;
COMPOSER_MEMORY_LIMIT = -1&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Given that a composer install, or update action will not be run so often, I would recommend the "unlimited setting" only as a one-time action, so do not leave it on the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compile with Node.js &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The most recent available node version on my Plesk environment is actually the number 17.7.2. I have found a good working setup with the version 14.x. So you can downgrade it (unless you need an exact version), selecting the 14.x version. Follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file called “.npmrc” on the root file system.&lt;/li&gt;
&lt;li&gt;Paste this line inside&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;scripts-prepend-node-path=true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then save it and go to the Node.js settings of your Plesk subscription.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable the Node.js environment in your subscription;&lt;/li&gt;
&lt;li&gt;Downgrade Node.js to the 14.x version;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62w0doy8a6tn93a4wmy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62w0doy8a6tn93a4wmy0.png" alt="Node.js Control panel on Plesk"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Click the “NPM Install” button, wait for the modules to be downloaded, then click the “Run Script” button;&lt;/li&gt;
&lt;li&gt;  Type “dev” in the “Script name and parameters” field, then click the “Run” button on the bottom of the modal.
If all goes well, you will see an output like this:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjydruuavnogjjoop7vm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjydruuavnogjjoop7vm1.png" alt="Executing Node.js"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If Node.js fails to compile your assets, try creating this environment variable instead of using the .npmrc file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scripts-prepend-node-path=true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will use the Node.js environment just to compile our js/css/other assets. If your project does not need a running Node.js code to be alive in production mode, we will disable it after the compile actions has finished executing, because Node.js wants to route our http requests instead of Laravel.&lt;br&gt;
Else we will need to setup an app.js routing file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file named “app.js” on the root, inside the “Home directory”.&lt;/li&gt;
&lt;li&gt;Paste this code inside, modifying it with your main domain, then save it.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

var http = require('http');
var fs = require('fs');

// create a http server
http.createServer(function (req, res) {    
        // redirect to your main domain with 301 (Moved Permanently) HTTP code in the response
        res.writeHead(301, { "Location": "HTTPS://WWW.YOURDOMAIN.COM/" });
        return res.end();
}).listen(8085);


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Using Artisan commands &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;We have two ways to execute our artisan commands: ssh terminals inside the browser, or via scheduled tasks.&lt;/p&gt;
&lt;h3&gt;
  
  
  Artisan via ssh terminals inside the browser
&lt;/h3&gt;

&lt;p&gt;If our subscription allows it, open the SSH terminal and find the right php executable:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;find /opt/plesk/php/*/bin/php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will give us a response like:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

-bash-4.2$ find /opt/plesk/php/*/bin/php
/opt/plesk/php/5.2/bin/php
/opt/plesk/php/5.3/bin/php
/opt/plesk/php/5.4/bin/php
/opt/plesk/php/5.5/bin/php
/opt/plesk/php/5.6/bin/php
/opt/plesk/php/7.0/bin/php
/opt/plesk/php/7.1/bin/php
/opt/plesk/php/7.2/bin/php
/opt/plesk/php/7.3/bin/php
/opt/plesk/php/7.4/bin/php
/opt/plesk/php/8.0/bin/php



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So we will execute the artisan commands prepending the right php exec version, this way:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/opt/plesk/php/8.0/bin/php artisan –help&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately, the web user doesn't have permission to setup custom aliases, because these will be deleted at the end of the CLI session.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using the Scheduled Tasks
&lt;/h3&gt;

&lt;p&gt;This method could be a bit slower, but it works and could be very useful.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the &lt;strong&gt;Scheduled Tasks panel&lt;/strong&gt; inside your subscriptions, then add a new Task.&lt;/li&gt;
&lt;li&gt;Disable the “&lt;strong&gt;Active&lt;/strong&gt;” checkbox, then select the “&lt;strong&gt;Run a PHP script&lt;/strong&gt;” task type.&lt;/li&gt;
&lt;li&gt;You can browse inside your file system and select the “artisan” file.&lt;/li&gt;
&lt;li&gt;You can then write your artisan commands in the “argument” field, as in the picture below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc1vua4g995ach805libu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc1vua4g995ach805libu.png" alt="Artisan commands"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Executing it will give you the expected output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j7g96gslc5h5ezzzwrc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j7g96gslc5h5ezzzwrc.png" alt="Executing artisan commands"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can save your new task without any arguments, and use it opening and changing them, according to your needs. Or you can save different scheduled tasks. I suggest the creation of these main common useful tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;migrate&lt;/li&gt;
&lt;li&gt;migrate:rollback&lt;/li&gt;
&lt;li&gt;optimize:clear&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So that, if you need, you can run them with a simple click every time you need.&lt;/p&gt;

&lt;p&gt;Remember: if you put your Laravel project in production, your migrate actions will not be available because each time you try to execute the artisan command, it will ask you for a confirmation that you cannot give because the Plesk scheduled task does not interact with the user. So you should put your project in dev mode before executing migrations or any other command that need interactions with you.&lt;/p&gt;

&lt;p&gt;I hope you find this post useful, happy coding!&lt;/p&gt;

</description>
      <category>laravel</category>
    </item>
  </channel>
</rss>
