<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Laravel &#8211; Best DevOps</title>
	<atom:link href="https://www.bestdevops.com/category/laravel/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bestdevops.com</link>
	<description>Lets Learn, Do it &#38; Share! Thats a Best DevOps!!!</description>
	<lastBuildDate>Wed, 01 Sep 2021 10:17:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>Composer: file_put_contents(./composer.json or ./composer.lock): failed to open stream: Permission denied</title>
		<link>https://www.bestdevops.com/composer-file_put_contents-composer-json-or-composer-lock-failed-to-open-stream-permission-denied/</link>
		
		<dc:creator><![CDATA[Sushant Kumar]]></dc:creator>
		<pubDate>Wed, 01 Sep 2021 05:19:33 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=20481</guid>

					<description><![CDATA[Problem When I run Composer update in my project then I got this error. Solution It can be resolved with [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="has-text-align-center wp-block-heading"><span class="has-inline-color has-primary-color">Problem</span></h1>



<p class="wp-block-paragraph">When I run Composer update in my project then I got this error.</p>


<pre class="wp-block-code"><span><code class="hljs">&#91;ErrorException]
  file_put_contents(./composer.lock): failed to open stream: Permission denied
</code></span></pre>


<h1 class="has-text-align-center wp-block-heading"><span class="has-inline-color has-primary-color">Solution</span></h1>



<p class="wp-block-paragraph">It can be resolved with the following command:</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">sudo chown -R $USER ~<span class="hljs-regexp">/.composer/</span></code></span></pre>


<p class="wp-block-paragraph">That&#8217;s all.</p>



<p class="wp-block-paragraph">I hope this article helps you to fix your issue.</p>



<p class="wp-block-paragraph">Thanks for reading.</p>



<p class="wp-block-paragraph">Keep Exploring.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The stream or file &#8220;/opt/lampp/htdocs/testproject/storage/logs/laravel-2021-08-31.log&#8221; could not be opened in append mode: failed to open stream: Permission denied</title>
		<link>https://www.bestdevops.com/the-stream-or-file-opt-lampp-htdocs-testproject-storage-logs-laravel-2021-08-31-log-could-not-be-opened-in-append-mode-failed-to-open-stream-permission-denied/</link>
		
		<dc:creator><![CDATA[Sushant Kumar]]></dc:creator>
		<pubDate>Tue, 31 Aug 2021 13:21:31 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=20465</guid>

					<description><![CDATA[Problem I&#8217;m getting this error after migrating my laravel project to linux server, see error below Solution the error is [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="has-text-align-center wp-block-heading"><span class="has-inline-color has-primary-color">Problem</span></h1>



<p class="wp-block-paragraph">I&#8217;m getting this error after migrating my laravel project to linux server, see error below</p>


<pre class="wp-block-code"><span><code class="hljs language-xml">UnexpectedValueException: The stream or file <span class="hljs-symbol">&amp;quot;</span>/opt/lampp/htdocs/testproject/storage/logs/laravel-2021-08-31.log<span class="hljs-symbol">&amp;quot;</span> could not be opened in append mode: failed to open stream: Permission denied in file /opt/lampp/htdocs/testproject/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 110
Stack trace:
  1. UnexpectedValueException-<span class="hljs-symbol">&amp;gt;</span>() /opt/lampp/htdocs/testproject/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:110
  2. Monolog\Handler\StreamHandler-<span class="hljs-symbol">&amp;gt;</span>write() /opt/lampp/htdocs/testproject/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php:120
  3. Monolog\Handler\RotatingFileHandler-<span class="hljs-symbol">&amp;gt;</span>write() /opt/lampp/htdocs/testproject/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:39
  4. Monolog\Handler\AbstractProcessingHandler-<span class="hljs-symbol">&amp;gt;</span>handle() /opt/lampp/htdocs/testproject/vendor/monolog/monolog/src/Monolog/Logger.php:344
  5. Monolog\Logger-<span class="hljs-symbol">&amp;gt;</span>addRecord() /opt/lampp/htdocs/testproject/vendor/monolog/monolog/src/Monolog/Logger.php:712
  6. Monolog\Logger-<span class="hljs-symbol">&amp;gt;</span>error() /opt/lampp/htdocs/testproject/vendor/laravel/framework/src/Illuminate/Log/Logger.php:176
  7. Illuminate\Log\Logger-<span class="hljs-symbol">&amp;gt;</span>writeLog() /opt/lampp/htdocs/testproject/vendor/laravel/framework/src/Illuminate/Log/Logger.php:87
  8. Illuminate\Log\Logger-<span class="hljs-symbol">&amp;gt;</span>error() /opt/lampp/htdocs/testproject/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:500
  9. Illuminate\Log\LogManager-<span class="hljs-symbol">&amp;gt;</span>error() /opt/lampp/htdocs/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:118
 10. Illuminate\Foundation\Exceptions\Handler-<span class="hljs-symbol">&amp;gt;</span>report() /opt/lampp/htdocs/testproject/app/Exceptions/Handler.php:37
 11. App\Exceptions\Handler-<span class="hljs-symbol">&amp;gt;</span>report() /opt/lampp/htdocs/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:92
 12. Illuminate\Foundation\Bootstrap\HandleExceptions-<span class="hljs-symbol">&amp;gt;</span>handleException() &#91;internal]:0</code></span></pre>


<h1 class="has-text-align-center wp-block-heading"><span class="has-inline-color has-primary-color">Solution</span></h1>



<p class="wp-block-paragraph">the error is that, Storage folder doesn&#8217;t  have permission to write log files, you can run</p>


<pre class="wp-block-code"><span><code class="hljs"> chmod -R o+w projectname/storage
 chmod -R o+w projectname/bootstrap</code></span></pre>


<p class="wp-block-paragraph">if you are using nginx then you need to use nginx user permission like below</p>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">sudo</span> <span class="hljs-selector-tag">chown</span> <span class="hljs-selector-tag">-R</span> <span class="hljs-selector-tag">nginx</span><span class="hljs-selector-pseudo">:root</span> <span class="hljs-selector-tag">storage</span>
<span class="hljs-selector-tag">sudo</span> <span class="hljs-selector-tag">chown</span> <span class="hljs-selector-tag">-R</span> <span class="hljs-selector-tag">nginx</span><span class="hljs-selector-pseudo">:root</span> <span class="hljs-selector-tag">bootstrap</span></code></span></pre>


<p class="wp-block-paragraph">That&#8217;s All.</p>



<p class="wp-block-paragraph">I hope this article helps you to solve the problem.</p>



<p class="wp-block-paragraph">Thanks for reading.</p>



<p class="wp-block-paragraph">Keep Exploring.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given, called in. Solved !</title>
		<link>https://www.bestdevops.com/argument-1-passed-to-illuminateauthsessionguardlogin-must-implement-interface-illuminatecontractsauthauthenticatable-null-given-called-in-solved/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Thu, 26 Aug 2021 09:46:57 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Authenticatable]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[socialite]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19785</guid>

					<description><![CDATA[This usually occurs when using of Laravel Socialite for authentication Socialite In addition to typical, form based authentication, Laravel also [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="216" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-125-1024x216.png" alt="" class="wp-image-19786" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-125-1024x216.png 1024w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-125-300x63.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-125-768x162.png 768w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-125-1536x324.png 1536w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-125.png 1542w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">This usually occurs when using of <strong>Laravel Socialite</strong> for authentication </p>



<h2 class="wp-block-heading" id="introduction">Socialite</h2>



<p class="wp-block-paragraph">In addition to typical, form based authentication, Laravel also provides a simple, convenient way to authenticate with OAuth providers using <a href="https://github.com/laravel/socialite">Laravel Socialite</a>. Socialite currently supports authentication with Facebook, Twitter, LinkedIn, Google, GitHub, GitLab, and Bitbucket.</p>



<h2 class="wp-block-heading">Error</h2>



<p class="wp-block-paragraph"><strong>Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given, called in C:\xampp\htdocs\WrokSpace\professional\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php on line 297</strong></p>



<h2 class="wp-block-heading">Solution </h2>



<p class="wp-block-paragraph"><strong>Just delete the social provider assigned to that user id from your database table and that&#8217;s it. </strong></p>



<figure class="wp-block-image size-full"><img decoding="async" width="206" height="30" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-126.png" alt="" class="wp-image-19787"/></figure>



<p class="wp-block-paragraph">Thankyou </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How To Set Up Task Scheduling With Cron Job In Laravel for Linux Server.</title>
		<link>https://www.bestdevops.com/how-to-set-up-task-scheduling-with-cron-job-in-laravel-for-linux-server/</link>
		
		<dc:creator><![CDATA[Sushant Kumar]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 10:02:00 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19173</guid>

					<description><![CDATA[Step 1:- Run the below command to Install Laravel 5.8 Step 2 :- Now, we need to create a custom [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong><span class="has-inline-color has-primary-color">Step 1:-</span> </strong>Run the below command to Install Laravel 5.8</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">composer create-project --prefer-dist laravel/laravel testingcronjob <span class="hljs-string">"5.8.*"</span></code></span></pre>


<p class="wp-block-paragraph"><strong><span class="has-inline-color has-primary-color">Step 2 :-</span></strong> Now, we need to create a custom command. Custom command will execute with task scheduling cron job. Run the below command to create new custom command</p>


<pre class="wp-block-code"><span><code class="hljs">php artisan make:command DemoCron --command=demo:cron</code></span></pre>


<p class="wp-block-paragraph">Now we make some changes on Command file.</p>



<h2 class="wp-block-heading"><strong>app/Console/Commands/DemoCron.php</strong></h2>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="php"><span class="hljs-meta">&lt;?php</span>
   
<span class="hljs-keyword">namespace</span> <span class="hljs-title">App</span>\<span class="hljs-title">Console</span>\<span class="hljs-title">Commands</span>;
   
<span class="hljs-keyword">use</span> <span class="hljs-title">Illuminate</span>\<span class="hljs-title">Console</span>\<span class="hljs-title">Command</span>;
   
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DemoCron</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Command</span>
</span>{
    <span class="hljs-comment">/**
     * The name and signature of the console command.
     *
     * <span class="hljs-doctag">@var</span> string
     */</span>
    <span class="hljs-keyword">protected</span> $signature = <span class="hljs-string">'demo:cron'</span>;
    
    <span class="hljs-comment">/**
     * The console command description.
     *
     * <span class="hljs-doctag">@var</span> string
     */</span>
    <span class="hljs-keyword">protected</span> $description = <span class="hljs-string">'Command description'</span>;
    
    <span class="hljs-comment">/**
     * Create a new command instance.
     *
     * <span class="hljs-doctag">@return</span> void
     */</span>
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">__construct</span><span class="hljs-params">()</span>
    </span>{
        <span class="hljs-keyword">parent</span>::__construct();
    }
    
    <span class="hljs-comment">/**
     * Execute the console command.
     *
     * <span class="hljs-doctag">@return</span> mixed
     */</span>
    <span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handle</span><span class="hljs-params">()</span>
    </span>{
        \Log::info(<span class="hljs-string">"Cron is working fine!"</span>);
     
        <span class="hljs-comment">/*
           Write your database logic we bellow:
           Item::create(&#91;'name'=&gt;'hello new']);
        */</span>
      
        <span class="hljs-keyword">$this</span>-&gt;info(<span class="hljs-string">'Demo:Cron Cummand Run successfully!'</span>);
    }
}</span></code></span></pre>


<p class="wp-block-paragraph"><span class="has-inline-color has-primary-color"><strong>Step 3 :-</strong> </span> Now, we need to define our commands on Kernel.php file with time when you want to run your command like as bellow functions:</p>



<figure class="wp-block-table"><table><tbody><tr><td>-&gt;everyMinute();</td><td>Run the task every minute</td></tr><tr><td>-&gt;everyFiveMinutes();</td><td>Run the task every five minutes</td></tr><tr><td>-&gt;everyTenMinutes();</td><td>Run the task every ten minutes</td></tr><tr><td>-&gt;everyFifteenMinutes();</td><td>Run the task every fifteen minutes</td></tr><tr><td>-&gt;everyThirtyMinutes();</td><td>Run the task every thirty minutes</td></tr><tr><td>-&gt;hourly();</td><td>Run the task every hour</td></tr><tr><td>-&gt;hourlyAt(17);</td><td>Run the task every hour at 17 mins past the hour</td></tr><tr><td>-&gt;daily();</td><td>Run the task every day at midnight</td></tr><tr><td>-&gt;dailyAt(’13:00′);</td><td>Run the task every day at 13:00</td></tr><tr><td>-&gt;twiceDaily(1, 13);</td><td>Run the task daily at 1:00 &amp; 13:00</td></tr><tr><td>-&gt;weekly();</td><td>Run the task every week</td></tr><tr><td>-&gt;weeklyOn(1, ‘8:00’);</td><td>Run the task every week on Tuesday at 8:00</td></tr><tr><td>-&gt;monthly();</td><td>Run the task every month</td></tr><tr><td>-&gt;monthlyOn(4, ’15:00′);</td><td>Run the task every month on the 4th at 15:00</td></tr><tr><td>-&gt;quarterly();</td><td>Run the task every quarter</td></tr><tr><td>-&gt;yearly();</td><td>Run the task every year</td></tr><tr><td>-&gt;timezone(‘America/New_York’);</td><td>Set the timezone</td></tr></tbody></table></figure>



<h2 class="wp-block-heading"><strong>app/Console/Kernel.php</strong></h2>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="php"><span class="hljs-meta">&lt;?php</span>
   
<span class="hljs-keyword">namespace</span> <span class="hljs-title">App</span>\<span class="hljs-title">Console</span>;
    
<span class="hljs-keyword">use</span> <span class="hljs-title">Illuminate</span>\<span class="hljs-title">Console</span>\<span class="hljs-title">Scheduling</span>\<span class="hljs-title">Schedule</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Illuminate</span>\<span class="hljs-title">Foundation</span>\<span class="hljs-title">Console</span>\<span class="hljs-title">Kernel</span> <span class="hljs-title">as</span> <span class="hljs-title">ConsoleKernel</span>;
    
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Kernel</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ConsoleKernel</span>
</span>{
    <span class="hljs-comment">/**
     * The Artisan commands provided by your application.
     *
     * <span class="hljs-doctag">@var</span> array
     */</span>
    <span class="hljs-keyword">protected</span> $commands = &#91;
        Commands\DemoCron::class,
    ];
     
    <span class="hljs-comment">/**
     * Define the application's command schedule.
     *
     * <span class="hljs-doctag">@param</span>  \Illuminate\Console\Scheduling\Schedule  $schedule
     * <span class="hljs-doctag">@return</span> void
     */</span>
    <span class="hljs-keyword">protected</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">schedule</span><span class="hljs-params">(Schedule $schedule)</span>
    </span>{
        $schedule-&gt;command(<span class="hljs-string">'demo:cron'</span>)
                 -&gt;everyMinute();
    }
     
    <span class="hljs-comment">/**
     * Register the commands for the application.
     *
     * <span class="hljs-doctag">@return</span> void
     */</span>
    <span class="hljs-keyword">protected</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">commands</span><span class="hljs-params">()</span>
    </span>{
        <span class="hljs-keyword">$this</span>-&gt;load(<span class="hljs-keyword">__DIR__</span>.<span class="hljs-string">'/Commands'</span>);
     
        <span class="hljs-keyword">require</span> base_path(<span class="hljs-string">'routes/console.php'</span>);
    }
}</span></code></span></pre>


<p class="wp-block-paragraph"><strong><span class="has-inline-color has-primary-color">Step 4 :-</span></strong> Now We&#8217;re ready to run our cron. You can manually check using following command of your cron.Run bellow command:</p>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">php</span> <span class="hljs-selector-tag">artisan</span> <span class="hljs-selector-tag">schedule</span><span class="hljs-selector-pseudo">:run</span></code></span></pre>


<p class="wp-block-paragraph">After running above command, now you can check log file where we already print some text. So open your log file it looks like as bellow:</p>



<p class="wp-block-paragraph"><strong>storage/logs/laravel-2021-08-16.php</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="636" height="290" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-89.png" alt="" class="wp-image-19198" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-89.png 636w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-89-300x137.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></figure></div>



<p class="wp-block-paragraph">Now our Cron is Working fine, But we want to run cron at every minute in our Linux Server,  So for that folow the below Steps.</p>



<p class="has-text-align-center wp-block-paragraph"> =========================   <strong>NOTE</strong> <strong>START</strong>   ========================== </p>



<h1 class="has-text-align-center wp-block-heading">Crontab Date / Time Format</h1>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="351" height="224" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-92.png" alt="" class="wp-image-19245" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-92.png 351w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-92-300x191.png 300w" sizes="auto, (max-width: 351px) 100vw, 351px" /></figure></div>



<pre class="wp-block-preformatted"> * * * * *  command to execute
 │ │ │ │ │
 │ │ │ │ │
 │ │ │ │ └───── day of week(0-6)(0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
 │ │ │ └────────── month (1 - 12)
 │ │ └─────────────── day of month (1 - 31)
 │ └──────────────────── hour (0 - 23)
 └───────────────────────── min (0 - 59)</pre>



<p class="has-text-align-center wp-block-paragraph">=========================   <strong>NOTE</strong> <strong>END</strong>   ==========================</p>



<p class="wp-block-paragraph"><strong><span class="has-inline-color has-primary-color">Step 5 :-</span></strong> Now login into your server and navigate to <strong>/etc</strong> and run below command</p>


<pre class="wp-block-code"><span><code class="hljs">sudo crontab -e</code></span></pre>


<p class="wp-block-paragraph">After running command you&#8217;ll get output like below image, just select <strong>easiest</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="410" height="140" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-90.png" alt="" class="wp-image-19221" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-90.png 410w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-90-300x102.png 300w" sizes="auto, (max-width: 410px) 100vw, 410px" /></figure></div>



<p class="wp-block-paragraph">In my case it&#8217;s 2, so I typed 2 and hit enter.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="801" height="338" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-91.png" alt="" class="wp-image-19225" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-91.png 801w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-91-300x127.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-91-768x324.png 768w" sizes="auto, (max-width: 801px) 100vw, 801px" /></figure></div>



<p class="wp-block-paragraph">now add single entry on crontab file</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">* * * * * php /path/to/artisan schedule:run <span class="hljs-number">1</span>&gt;&gt; <span class="hljs-regexp">/dev/</span><span class="hljs-literal">null</span> <span class="hljs-number">2</span>&gt;&amp;<span class="hljs-number">1</span>


OR

* * * * * cd /path-to-your-project &amp;&amp; php artisan schedule:run &gt;&gt; <span class="hljs-regexp">/dev/</span><span class="hljs-literal">null</span> <span class="hljs-number">2</span>&gt;&amp;<span class="hljs-number">1</span></code></span></pre>


<p class="wp-block-paragraph"> I&#8217;m running on my linux server so i&#8217;ve added path to my artisan file of my laravel project, see below </p>



<h2 class="wp-block-heading">my code</h2>


<pre class="wp-block-code"><span><code class="hljs language-javascript">* * * * * php /opt/lampp/htdocs/testingcronjob/artisan schedule:run <span class="hljs-number">1</span>&gt;&gt; <span class="hljs-regexp">/dev/</span><span class="hljs-literal">null</span> <span class="hljs-number">2</span>&gt;&amp;<span class="hljs-number">1</span></code></span></pre>


<p class="wp-block-paragraph">It&#8217;s Done. I hope this article help you.</p>



<p class="wp-block-paragraph">Keep Exploring.</p>



<p class="wp-block-paragraph">Thanks for reading.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Laravel Permissions to set on Storage folder on Linux.</title>
		<link>https://www.bestdevops.com/laravel-permissions-to-set-on-storage-folder-on-linux/</link>
		
		<dc:creator><![CDATA[Sushant Kumar]]></dc:creator>
		<pubDate>Mon, 16 Aug 2021 07:30:00 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[laravel application]]></category>
		<category><![CDATA[Laravel Permissions]]></category>
		<category><![CDATA[Laravel Permissions on Storage folder]]></category>
		<category><![CDATA[Linux Permissions for Laravel]]></category>
		<category><![CDATA[Storage folder Permissions]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19025</guid>

					<description><![CDATA[When we Setup laravel project on linux server then we have to give permissions to all folder&#8217;s, sub-folder&#8217;s and files [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When we Setup laravel project on linux server then we have to give permissions to all folder&#8217;s, sub-folder&#8217;s and files in laravel Storage folder. So, i&#8217;m providing the list of permission which you have to set in storage folder. I&#8217;m providing this list because we can&#8217;t set <strong>777</strong> permission to all folders, if we do then it&#8217;s may be a security concern.</p>



<p class="wp-block-paragraph">So i&#8217;m providing a complete list of each folder&#8217;s and sub-folder&#8217;s permissions.</p>



<ol class="wp-block-list"><li><strong>storage </strong>&#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.<br><br></li><li><strong>storage/app</strong> &#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.<br><strong>storage/app/public</strong> &#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.<br><br></li><li><strong>storage/framework</strong> &#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.<br><strong>storage/framework/views</strong> &#8211; <strong><span class="has-inline-color has-primary-color">777</span></strong>.<br><strong>storage/framework/testing</strong> &#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.<br><strong>storage/framework/sessions</strong> &#8211; <strong><span class="has-inline-color has-primary-color">777</span></strong>.<br><strong>storage/framework/cache</strong> &#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.<br></li><li><strong>storage/logs</strong> &#8211; <strong><span class="has-inline-color has-primary-color">755</span></strong>.</li></ol>



<p class="wp-block-paragraph">That&#8217;s all. Hope this article will solved your problem.</p>



<p class="wp-block-paragraph">Keep Exploring.</p>



<p class="wp-block-paragraph">Thanks for reading.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Deploy a Laravel project to ubuntu server using git</title>
		<link>https://www.bestdevops.com/deploy-a-laravel-project-to-ubuntu-server-using-git/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 12:53:48 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[gitbash]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[xampp]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18823</guid>

					<description><![CDATA[Steps to create project in local machine Step :1 Create a folder anywhere in your local computer with any name [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Steps to create project in local machine</h2>



<h3 class="wp-block-heading">Step :1 Create a folder anywhere in your local computer with any name (Mine is workspace)</h3>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="127" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-49-1024x127.png" alt="" class="wp-image-18824" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-49-1024x127.png 1024w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-49-300x37.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-49-768x96.png 768w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-49.png 1141w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>You can go for any name you want</figcaption></figure>



<h3 class="wp-block-heading">Step:2 Make sure git and gitbash is installed in your local machine if not download it from <a href="https://git-scm.com/downloads" target="_blank" rel="noreferrer noopener">here</a></h3>



<h3 class="wp-block-heading">Step:3 Login into your GitHub account and create a repository</h3>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-50.png" alt="" class="wp-image-18825" width="623" height="649" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-50.png 698w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-50-288x300.png 288w" sizes="auto, (max-width: 623px) 100vw, 623px" /></figure>



<h3 class="wp-block-heading">Step 4: Clone the repository into your local machine </h3>



<ul class="wp-block-list"><li>get inside your repository </li></ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="912" height="354" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-51.png" alt="" class="wp-image-18826" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-51.png 912w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-51-300x116.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-51-768x298.png 768w" sizes="auto, (max-width: 912px) 100vw, 912px" /></figure>



<ul class="wp-block-list"><li>Copy the URL under HTTPS area </li><li>There are many more ways to clone a repo but for time being use this method </li><li>Now get inside our workspace folder that we created before (local/workspace)</li><li>right click and open git bash or command line inside the folder </li></ul>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="843" height="390" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-52.png" alt="" class="wp-image-18827" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-52.png 843w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-52-300x139.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-52-768x355.png 768w" sizes="auto, (max-width: 843px) 100vw, 843px" /></figure>



<ul class="wp-block-list"><li>Run these git commands to get started </li></ul>


<pre class="wp-block-code"><span><code class="hljs">git init </code></span></pre>


<pre class="wp-block-preformatted">This is to&nbsp;initialize a new, empty repository </pre>


<pre class="wp-block-code"><span><code class="hljs language-php">git <span class="hljs-keyword">clone</span> https:<span class="hljs-comment">//github.com/pradeeprjth/laravelTestingProject.git &#91;HTTPS_URL_YOU_COPYED_FROM_GITHUB] </span></code></span></pre>


<pre class="wp-block-preformatted">This will clone everything stored in your remote repository into your local folder/repository
You will find a folder with the same name you created your repository </pre>



<h3 class="wp-block-heading">Step :5 paste your project/code inside the folder you just clone from the repository </h3>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-53.png" alt="" class="wp-image-18828" width="691" height="563" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-53.png 691w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-53-300x244.png 300w" sizes="auto, (max-width: 691px) 100vw, 691px" /></figure>



<ul class="wp-block-list"><li>Again run the below commands to push all the changes and codes back to the repository </li><li>Right click and open your git bash or cmd inside the folder </li></ul>


<pre class="wp-block-code"><span><code class="hljs">git add .</code></span></pre>


<pre class="wp-block-preformatted">The git add command&nbsp;<strong>adds a file to the Git staging area</strong>. This area contains a list of all the files you have recently changed.</pre>


<pre class="wp-block-code"><span><code class="hljs language-javascript">git commit -m<span class="hljs-string">"first_commit"</span></code></span></pre>


<pre class="wp-block-preformatted"><em>git commit</em>&nbsp;creates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. and you need to specify a commit message using -m flag including double quote</pre>


<pre class="wp-block-code"><span><code class="hljs">git push origin master    or    git push origin main </code></span></pre>


<pre class="wp-block-preformatted">git push -u origin master is&nbsp;<strong>used for pushing local content to GitHub</strong></pre>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-54.png" alt="" class="wp-image-18829" width="725" height="460" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-54.png 935w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-54-300x191.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-54-768x488.png 768w" sizes="auto, (max-width: 725px) 100vw, 725px" /><figcaption>Sorry for the CLI style I like it in this way </figcaption></figure>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading">Step 6: Login to your remote machine or ubuntu machine and make sure xampp and composer is installed in that machine.</h3>



<p class="wp-block-paragraph">Follow this blog if xampp and composer are not installed in your remote/ubuntu machine </p>



<h3 class="wp-block-heading">1. Installed Xampp</h3>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><a href="https://www.devopsschool.com/blog/installing-xampp-7-4-xxx-on-ubuntu/">How to install and Configure XAMPP on Ubuntu?</a></p><cite>This blog is written by Rajesh thanks to him.</cite></blockquote>



<h3 class="wp-block-heading">2. Another thing which is required is Composer</h3>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><a href="https://www.bestdevops.com/install-composer-using-cli-in-ubuntu-globally/">Install composer using CLI in ubuntu (Globally)</a></p><cite>Follow this to install composer in your machine using CLI</cite></blockquote>



<h3 class="wp-block-heading">Stpe :7 Go to your htdocs folder or if you have lampp then www  folder and run below commands</h3>


<pre class="wp-block-code"><span><code class="hljs">git init </code></span></pre>


<pre class="wp-block-preformatted"> This is to&nbsp;initialize a new, empty repository but this time inside your remote machine </pre>


<pre class="wp-block-code"><span><code class="hljs language-php">git <span class="hljs-keyword">clone</span> https:<span class="hljs-comment">//github.com/pradeeprjth/laravelTestingProject.git &#91;HTTPS_URL_YOU_COPYED_FROM_GITHUB]</span></code></span></pre>


<pre class="wp-block-preformatted">Now as we already have pushed all our code into our repository so we'll get all the files folder into our htdocs folder or www folder </pre>



<h3 class="wp-block-heading">Step 8: Now to run the project we need to do some configuration </h3>



<ul class="wp-block-list"><li>Copy the .env.example file to .env coz git ignore some files and folder including our vendor folder which contains all our Laravel project files . To do this run the below command.</li></ul>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">cp</span> <span class="hljs-selector-class">.env</span><span class="hljs-selector-class">.example</span> <span class="hljs-selector-class">.env</span></code></span></pre>


<ul class="wp-block-list"><li>Install composer, as git ignores our vendor folder in order to get it back we need to run </li></ul>


<pre class="wp-block-code"><span><code class="hljs">composer install</code></span></pre>


<ul class="wp-block-list"><li>You may get an error while composer install </li><li><em>Class &#8216;Illuminate\Support\facades\Schema not found </em></li><li>In order to solve this go to your project folder in local and inside C:\xampp\htdocs\WrokSpace\laravelTestproject\app\Providers\AppServiceProvider.php</li><li>use this class in the top <br>use Illuminate\Support\Facades\Schema;</li></ul>



<ul class="wp-block-list"><li>Next thing is to set the APP_KEY value in your .env file, run the command below </li></ul>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">php</span> <span class="hljs-selector-tag">artisan</span> <span class="hljs-selector-tag">key</span><span class="hljs-selector-pseudo">:generate</span></code></span></pre>


<h3 class="wp-block-heading">Step 9: Now go to your browser and put your ip followed by the project name /public to visit the application</h3>



<h3 class="wp-block-heading">  </h3>


<pre class="wp-block-code"><span><code class="hljs language-javascript">http:<span class="hljs-comment">//90.437.1965.252/laravelTestproject/public/</span></code></span></pre>


<p class="wp-block-paragraph">That&#8217;s it hope it help&#8217;s someone out there.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Laravel : Regex Validation For Password</title>
		<link>https://www.bestdevops.com/laravel-regex-validation-for-password/</link>
		
		<dc:creator><![CDATA[Sushant Kumar]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 11:10:50 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[Regex Validation]]></category>
		<category><![CDATA[Validation For Password]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18810</guid>

					<description><![CDATA[Minimum eight characters, at least one letter and one number: Minimum eight characters, at least one letter, one number and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading"><strong>Minimum eight characters, at least one letter and one number:</strong></h3>


<pre class="wp-block-code"><span><code class="hljs language-json"><span class="hljs-string">"^(?=.*&#91;A-Za-z])(?=.*\d)&#91;A-Za-z\d]{8,}$"</span></code></span></pre>


<h3 class="wp-block-heading"><strong>Minimum eight characters, at least one letter, one number and one special character:</strong></h3>


<pre class="wp-block-code"><span><code class="hljs language-json"><span class="hljs-string">"^(?=.*&#91;A-Za-z])(?=.*\d)(?=.*&#91;@$!%*#?&amp;])&#91;A-Za-z\d@$!%*#?&amp;]{8,}$"</span></code></span></pre>


<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:</strong></h3>


<pre class="wp-block-code"><span><code class="hljs language-json"><span class="hljs-string">"^(?=.*&#91;a-z])(?=.*&#91;A-Z])(?=.*\d)&#91;a-zA-Z\d]{8,}$"</span></code></span></pre>


<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character:</strong></h3>


<pre class="wp-block-code"><span><code class="hljs language-json"><span class="hljs-string">"^(?=.*&#91;a-z])(?=.*&#91;A-Z])(?=.*\d)(?=.*&#91;@$!%*?&amp;])&#91;A-Za-z\d@$!%*?&amp;]{8,}$"</span></code></span></pre>


<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>Minimum eight and maximum 10 characters, at least one uppercase letter, one lowercase letter, one number and one special character:</strong></h3>


<pre class="wp-block-code"><span><code class="hljs language-json"><span class="hljs-string">"^(?=.*&#91;a-z])(?=.*&#91;A-Z])(?=.*\d)(?=.*&#91;@$!%*?&amp;])&#91;A-Za-z\d@$!%*?&amp;]{8,10}$"</span></code></span></pre>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Permissions required to make a Laravel project up and running in ubuntu (Linux)</title>
		<link>https://www.bestdevops.com/permissions-required-to-make-a-laravel-project-up-and-running-in-ubuntu-linux/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 11:04:26 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[permission_denied]]></category>
		<category><![CDATA[session]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18807</guid>

					<description><![CDATA[Before moving further, hope you have already installed xampp and composer in your machine.if not follow the below blog to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Before moving further, hope you have already installed xampp and composer in your machine.<br>if not follow the below blog to do so.</h2>



<figure class="wp-block-embed is-type-wp-embed is-provider-devops-devsecops-sre-dataops-aiops wp-block-embed-devops-devsecops-sre-dataops-aiops"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="ipO4OKcLIx"><a href="https://www.bestdevops.com/install-a-laravel-project-inside-htdocs-folder-in-ubuntu/">Install a Laravel project inside htdocs folder in ubuntu</a></blockquote><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Install a Laravel project inside htdocs folder in ubuntu&#8221; &#8212; Best DevOps" src="https://www.bestdevops.com/install-a-laravel-project-inside-htdocs-folder-in-ubuntu/embed/#?secret=J1P7D2j1fx#?secret=ipO4OKcLIx" data-secret="ipO4OKcLIx" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="636" height="186" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-48.png" alt="" class="wp-image-18808" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-48.png 636w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-48-300x88.png 300w" sizes="auto, (max-width: 636px) 100vw, 636px" /></figure>



<h1 class="wp-block-heading">First permission:</h1>



<p class="wp-block-paragraph">As you know the first thing our browser needs to run a Laravel project is, the index file which is located in the public folder <br>so we need to make it read and writable so that our browser can access it and if required can modify it.</p>



<p class="wp-block-paragraph">Run the below command to grant access to the public folder </p>


<pre class="wp-block-code"><span><code class="hljs language-php">cd /opt/lampp/htdocs/YOUR_PROJECT
sudo chmod -R +rw <span class="hljs-keyword">public</span></code></span></pre>


<h1 class="wp-block-heading">Second permission:</h1>



<p class="wp-block-paragraph">The next permission if for the storage folder, as you already know when our Laravel projects runs it create some logs files automatically if any error found in you code base, </p>



<p class="wp-block-paragraph">Run the below command to grant access to the logs folder </p>


<pre class="wp-block-code"><span><code class="hljs">cd /opt/lampp/htdocs/YOUR_PROJECT
sudo chmod -R +rw storage</code></span></pre>


<h1 class="wp-block-heading">Third permission:</h1>



<p class="wp-block-paragraph">At the end, the final permission we have to give to our session folder which is located inside our <strong>storage/framework</strong> folder,<br>and every time we hit our project URL a new random session key is generated, that get stored in our session folder <br>so all of them are necessary to run a Laravel project </p>



<p class="wp-block-paragraph">Run the below command to grand access to the <strong>framework </strong>and session </p>


<pre class="wp-block-code"><span><code class="hljs">sudo chmod -R 775 framework
sudo chmod -R 775 session</code></span></pre>


<p class="wp-block-paragraph">That&#8217;s it, these all works for me hope it for you too </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Install a Laravel project inside htdocs folder in ubuntu</title>
		<link>https://www.bestdevops.com/install-a-laravel-project-inside-htdocs-folder-in-ubuntu/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 09:49:10 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[composer]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[mbstring]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[xampp]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18793</guid>

					<description><![CDATA[I was moving a Laravel project to a ubuntu virtual machine.Steps that I followed: 1. Installed Xampp 2. Another thing [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">I was moving a Laravel project to a  ubuntu  virtual machine.<br>Steps that I followed:</h3>



<h3 class="wp-block-heading">1.  Installed Xampp </h3>



<figure class="wp-block-embed is-type-wp-embed is-provider-devopsschool-com wp-block-embed-devopsschool-com"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="lwILFIsreb"><a href="https://www.devopsschool.com/blog/installing-xampp-7-4-xxx-on-ubuntu/">How to install  and Configure XAMPP  on Ubuntu?</a></blockquote><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;How to install  and Configure XAMPP  on Ubuntu?&#8221; &#8212; DevOpsSchool.com" src="https://www.devopsschool.com/blog/installing-xampp-7-4-xxx-on-ubuntu/embed/#?secret=AiPeZ0yBbG#?secret=lwILFIsreb" data-secret="lwILFIsreb" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div><figcaption>By following this blog i was successfully xampp running on my machine. Thanks to the auther Rajesh Kumar</figcaption></figure>



<h3 class="wp-block-heading">2. Another thing which is required is Composer </h3>



<figure class="wp-block-embed is-type-wp-embed is-provider-devops-devsecops-sre-dataops-aiops wp-block-embed-devops-devsecops-sre-dataops-aiops"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="ep8po4mbU8"><a href="https://www.bestdevops.com/install-composer-using-cli-in-ubuntu-globally/">Install composer using CLI in ubuntu (Globally)</a></blockquote><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Install composer using CLI in ubuntu (Globally)&#8221; &#8212; Best DevOps" src="https://www.bestdevops.com/install-composer-using-cli-in-ubuntu-globally/embed/#?secret=EhSiZXmf7j#?secret=ep8po4mbU8" data-secret="ep8po4mbU8" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h3 class="wp-block-heading">3. Now the thing is when we try to install Laravel project inside our htdocs folder it through an error</h3>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="884" height="260" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-42.png" alt="" class="wp-image-18795" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-42.png 884w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-42-300x88.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-42-768x226.png 768w" sizes="auto, (max-width: 884px) 100vw, 884px" /></figure>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading">4. To resolve this error first create a folder inside your htdocs.</h3>


<pre class="wp-block-code"><span><code class="hljs">mkdir Projects</code></span></pre>


<h3 class="wp-block-heading">5 grant read and write permissions to this folder by running this commands</h3>


<pre class="wp-block-code"><span><code class="hljs">sude chmod +rw Projects</code></span></pre>


<h3 class="wp-block-heading">6. You may get another error while installing is (&#8220;mbstring&#8221; extension is missing.)</h3>



<p class="wp-block-paragraph">Run the below commands to resolve these errors</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">sudo apt-<span class="hljs-keyword">get</span> install php-mbstring
</code></span></pre>

<pre class="wp-block-code"><span><code class="hljs">sudo su - root
</code></span></pre>


<h3 class="wp-block-heading">7. That&#8217;s it now try installing your project again </h3>


<pre class="wp-block-code"><span><code class="hljs language-javascript">composer create-project --prefer-dist laravel/laravel testProject <span class="hljs-string">"5.8.*"</span></code></span></pre>


<p class="wp-block-paragraph">That&#8217;s it, Hope it help someone out there.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>require ext-dom * -&gt; it is missing from your system. Install or enable PHP&#8217;s dom extension.</title>
		<link>https://www.bestdevops.com/require-ext-dom-it-is-missing-from-your-system-install-or-enable-phps-dom-extension/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 07:22:56 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[installPHPComposer]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php&#039;s_domExtenstion]]></category>
		<category><![CDATA[project]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18755</guid>

					<description><![CDATA[Make sure you are in htdocs folder while executing the commands. I was trying to install Laravel in a Ubuntu [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading"><strong>Make sure you are in htdocs folder while executing the commands.</strong></h2>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-40.png" alt="" class="wp-image-18766" width="523" height="446" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-40.png 737w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-40-300x256.png 300w" sizes="auto, (max-width: 523px) 100vw, 523px" /></figure>



<h2 class="wp-block-heading">I was trying to install Laravel in a Ubuntu virtual machine and got this error </h2>



Your requirements could not be resolved to an installable set of packages.
  Problem 1
    &#8211; phpunit/phpunit[7.5.0, &#8230;, 7.5.20] require ext-dom * -&gt; it is missing from your system. Install or enable PHP&#8217;s dom extension.
    &#8211; Root composer.json requires phpunit/phpunit ^7.5 -&gt; satisfiable by phpunit/phpunit[7.5.0, &#8230;, 7.5.20].



<h3 class="wp-block-heading">And To enable extensions, verify that they are enabled in your .ini files:</h3>



<p class="wp-block-paragraph">But in your server you&#8217;re missing&nbsp;<code>ext-dom</code>.&nbsp;<code>php-xml</code>&nbsp;has all the related packages you need. So, you can simply install it by running:</p>


<pre class="wp-block-code"><span><code class="hljs">sudo apt install php-xml</code></span></pre>


<h3 class="wp-block-heading">Most likely you are missing&nbsp;<code>mbstring</code>&nbsp;too. If you get the error, install this package as well with:</h3>


<pre class="wp-block-code"><span><code class="hljs language-javascript">sudo apt-<span class="hljs-keyword">get</span> install php-mbstring</code></span></pre>


<h3 class="wp-block-heading">Then run:</h3>


<pre class="wp-block-code"><span><code class="hljs language-javascript">composer update
composer <span class="hljs-built_in">require</span> cviebrock/eloquent-sluggable</code></span></pre>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Adding an Auto-Complete Address Field to your Forms (Laravel)</title>
		<link>https://www.bestdevops.com/adding-an-auto-complete-address-field-to-your-forms-laravel/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 07:43:21 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[AutoComplete]]></category>
		<category><![CDATA[autoFetchAddress]]></category>
		<category><![CDATA[autofillAddress]]></category>
		<category><![CDATA[googleMapsPlace]]></category>
		<category><![CDATA[googlePlaceApi]]></category>
		<category><![CDATA[locationCoordinates]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18704</guid>

					<description><![CDATA[First of all we need to get a google maps API, go through this documentation to get an API of [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="403" src="https://www.bestdevops.com/wp-content/uploads/2021/08/croped-autoAddress-3-1024x403.png" alt="" class="wp-image-18710" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/croped-autoAddress-3-1024x403.png 1024w, https://www.bestdevops.com/wp-content/uploads/2021/08/croped-autoAddress-3-300x118.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/croped-autoAddress-3-768x302.png 768w, https://www.bestdevops.com/wp-content/uploads/2021/08/croped-autoAddress-3.png 1167w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>What we are building</figcaption></figure>



<h3 class="wp-block-heading"> First of all we need to get  a google maps API, go through this <a href="https://developers.google.com/maps/documentation/javascript/get-api-key">documentation </a>to get an API of your own.<br></h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="251" src="http://www.bestdevops.com/wp-content/uploads/2021/08/image-33-1024x251.png" alt="" class="wp-image-18692" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-1024x251.png 1024w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-300x73.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-768x188.png 768w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-33.png 1307w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>we need Geocoding API and Maps JavaScript API</figcaption></figure>



<h3 class="wp-block-heading">Next thing we need to do is to put a initializing script in our blade file </h3>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initAutocomplete&amp;libraries=places&amp;v=weekly"</span><span class="hljs-attr">async</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></span></pre>


<ul class="wp-block-list"><li>Make sure to provide your api key in the script </li></ul>



<p class="wp-block-paragraph">The above script will call a method name initAutocomplete that we have to write in our .js file </p>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span> 
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row mt-3"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-md-12"</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"address-input"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"address1"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-control"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">""</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"hidden"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"address_latitude"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"address-latitude"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">""</span> <span class="hljs-attr">required</span>/ &gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"hidden"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"address_longitude"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"address-longitude"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">""</span> <span class="hljs-attr">required</span>/&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"btn btn-primary"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"submit"</span>&gt;</span>Save Profile<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span></code></span></pre>


<ul class="wp-block-list"><li>Make sure you form have these matching selectors </li></ul>



<script src="https://gist.github.com/pradeeprjth/64fbf47b6a04f67b17dea57d2fd57ef2.js"></script>



<p class="wp-block-paragraph">What i have done in above code</p>



<ul class="wp-block-list"><li>In the above code the first method initAutocomplete() method is initializing by our script call-back </li><li>Next thing we are getting the input keywords in locationInput constant </li><li>Then with the help of geocoder we are manipulating our provided key word to form let long and</li><li>Next we initializing  <em>autocomplete = new </em>google.maps.places.Autocomplete(input); </li><li>At the end we are getting the provide address in our place variable </li><li>There is an another method setLocationCoordinates() i used this method to set let long so that I can store the co-ordinates along with the address in DB </li></ul>



<p class="wp-block-paragraph">That&#8217;s it, hope this help ;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to get current city name using google maps API (Laravel)</title>
		<link>https://www.bestdevops.com/how-to-get-current-city-name-using-google-maps-api-laravel/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 06:53:25 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[currentAddress]]></category>
		<category><![CDATA[CurrentCity]]></category>
		<category><![CDATA[CurrentCountry]]></category>
		<category><![CDATA[geoLocation]]></category>
		<category><![CDATA[googleMAPsApi]]></category>
		<category><![CDATA[Location]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18691</guid>

					<description><![CDATA[First of all we need to get a google maps API, go through this documentation to get an API of [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="725" height="174" src="https://www.bestdevops.com/wp-content/uploads/2021/08/location-1.png" alt="" class="wp-image-18695" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/location-1.png 725w, https://www.bestdevops.com/wp-content/uploads/2021/08/location-1-300x72.png 300w" sizes="auto, (max-width: 725px) 100vw, 725px" /><figcaption>Create this html form and make sure you have two hidden input with id let and long</figcaption></figure>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading">First of all we need to get  a google maps API, go through this <a href="https://developers.google.com/maps/documentation/javascript/get-api-key">documentation </a>to get an API of your own.<br>https://developers.google.com/maps/documentation/javascript/get-api-key</h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="251" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-1024x251.png" alt="" class="wp-image-18692" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-1024x251.png 1024w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-300x73.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-33-768x188.png 768w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-33.png 1307w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>You only need Geocoding API and Maps JavaScript API</figcaption></figure>



<h3 class="wp-block-heading">Place this script in your blade file if your are using Laravel or in your HTML inside body tags.</h3>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap&amp;libraries=&amp;v=weekly"</span><span class="hljs-attr">defer</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></span></pre>


<p class="wp-block-paragraph">Make sure to put your API key in the place of YOUR_API_KEY in provided script above </p>



<h4 class="wp-block-heading">Next thing you need to do after initializing the map is to create a method in jQuery for the call-back method  <em>initMap</em> , it should match the the same callback in the script </h4>



<h3 class="wp-block-heading">After this first thing we need to do is to get our current location (let, long)</h3>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"btn btn-success"</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">"getAddress()"</span>&gt;</span>Get Location<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></code></span></pre>


<script src="https://gist.github.com/pradeeprjth/b4cc691c69dc4d97633bf7d311254cfe.js"></script>



<h2 class="wp-block-heading">What we have done in above js code</h2>



<ul class="wp-block-list"><li>getAddress method will get the current let long using geolocation that is provided by HTML;</li><li>in the second function we are setting the value of two hidden input fields with the current let long;</li><li>The initMap method will be called by our script that we initialized earlier</li><li>The initMap method will call geocodeLatLng  method to get the current let long from those hidden input</li><li>Next thing we&#8217;re doing is splitting and formatting the let long value to provide it to geocoder</li><li>you will get your current city name in this address variable</li><li>Console Log the result variable and you&#8217;ll find more properties provide by geocode like long name, short name, postal code, area building number etc etc</li></ul>



<h2 class="wp-block-heading">That&#8217;s it hope this help </h2>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Create a rating system using Bootstrap, jQuery &#038; Ajax</title>
		<link>https://www.bestdevops.com/create-a-rating-system-using-bootstrap-ajax-laravel/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 06:06:05 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Website]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18686</guid>

					<description><![CDATA[#1 First include a button that trigger our Bootstrap model to take users rating and review #2 This is my [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">#1 First include a button that trigger our Bootstrap model to take users rating and review  </h3>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"ratenow btn btn-success btn-sm border"</span>&gt;</span>Rate Now<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></code></span></pre>


<h3 class="wp-block-heading">#2 This is my bootstrap model </h3>



<script src="https://gist.github.com/pradeeprjth/a3cb8c18daee05c6b19893a64184958a.js"></script>



<h3 class="wp-block-heading">#3 jQuery to get the review and rating from bootstrap model and send it to database using ajax</h3>



<script src="https://gist.github.com/pradeeprjth/16ca1f87e1d6c9787302c33d75abee17.js"></script>



<h3 class="wp-block-heading">#4 That&#8217;s it if you want to rate a particular user take the user id along with the order id like i did with the order_id and you&#8217;ll be good to go </h3>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
