<?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>Forem: saf</title>
    <description>The latest articles on Forem by saf (@saf2026).</description>
    <link>https://forem.com/saf2026</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%2F370294%2F61183168-e0e6-495d-bd9c-e0e854367454.jpeg</url>
      <title>Forem: saf</title>
      <link>https://forem.com/saf2026</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/saf2026"/>
    <language>en</language>
    <item>
      <title>Install Kali Linux</title>
      <dc:creator>saf</dc:creator>
      <pubDate>Mon, 27 Jul 2020 05:55:19 +0000</pubDate>
      <link>https://forem.com/saf2026/install-kali-linux-3272</link>
      <guid>https://forem.com/saf2026/install-kali-linux-3272</guid>
      <description>&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/jsafe00" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fdefault-green.png" alt="Buy Me A Coffee" width="434" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Kali Linux?
&lt;/h1&gt;

&lt;p&gt;So, I have an old laptop which I have not used for quite some time now and was thinking on turning this into something useful. Kali Linux is a powerful toolkit for security testing. And I think it is nice to explore and learn Kali Linux during this pandemic. &lt;/p&gt;

&lt;h5&gt;
  
  
  Requirements:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Kali Linux Installer – Kali linux  installer can be   downloaded at: &lt;a href="https://www.kali.org/downloads/" rel="noopener noreferrer"&gt;https://www.kali.org/downloads/&lt;/a&gt;. Make sure to download depending on your computer system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PowerISO – PowerISO is  used to create bootable USB drive. You can download PowerISO here: &lt;a href="https://www.poweriso.com/" rel="noopener noreferrer"&gt;https://www.poweriso.com/&lt;/a&gt; . I tried using rufus , pen drive linux and balenaEtcher but none of these works for me. You can choose whatever bootable usb software you like. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;USB flash drive (4gb or greater)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Create Bootable USB Drive
&lt;/h5&gt;

&lt;p&gt;Follow the steps from &lt;a href="https://www.poweriso.com/tutorials/how-to-make-win7-bootable-usb-drive.htm" rel="noopener noreferrer"&gt;https://www.poweriso.com/tutorials/how-to-make-win7-bootable-usb-drive.htm&lt;/a&gt; if you are not familiar with creating a bootable usb drive.&lt;/p&gt;

&lt;h5&gt;
  
  
  Once everything is done, follow the steps below to install Kali Linux on your machine.
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt; Boot Kali Linux installer image &lt;/li&gt;
&lt;li&gt; Once booted, select graphical install&lt;/li&gt;
&lt;li&gt; Select your preferred language &lt;/li&gt;
&lt;li&gt; Select your location. The selected location will be used to set your time zone.
&lt;/li&gt;
&lt;li&gt; Configure keyboard keymap. As per research, American English is recommended.&lt;/li&gt;
&lt;li&gt; Set your machine hostname. 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9xsbtxkiwmx9ampaczro.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt; Configure the network 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkfqfd4n2uwzbimfx6z0n.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt; Set your username and password 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwkaqhxjf7rko4htacnek.png" alt="Alt Text" width="800" height="600"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp790brtc0kfoe3mil7c8.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt; Set your timezone 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F11yf39n6idh254e4sn4r.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt;Choose partition disk. You can set your own preference on this. But in my case I just leave all files in one partition.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffu6jfde4tdncnrd0kobg.png" alt="Alt Text" width="800" height="600"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkzat7r6hqckfp5ouofvx.png" alt="Alt Text" width="800" height="600"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fogodwghr1rle1mfpm82x.png" alt="Alt Text" width="800" height="600"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxw42ifnkt6bu0edoz5t9.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt;If you have a network proxy for external access, configure it on this screen 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3tvo40bb4w9a1kz9babm.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt;Choose software to install.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsfgkm7lcrp3duej0w12y.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt;Install the GRUB boot loader to the master boot record so you can boot your Kali Linux image.  Then, select target disk for GRUB installation. Mostly, it is the first  disk. 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn9ftl97612pgb927gi98.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;li&gt;If you don’t have any error during the installation, then your installation is successful. Else, leave a comment below and we'll try to solve it.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F266fbr2qpij04cj44u8y.png" alt="Alt Text" width="800" height="600"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Let our Kali Linux  adventure begin. :)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcjlklrzhlcm74rgfpez0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcjlklrzhlcm74rgfpez0.png" alt="Alt Text" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Have you ever just stopped what you are doing and focused on the mind and its endless procession of thoughts? Try it sometime, there is a lot going on up there! This is how the mind works, but there is a drawback to this natural process. Most of our errant thoughts are rooted in the past and future – thoughts of fear, fantasy, frustration, envy and regret. Rarely are we completely rooted in the present moment. As Eckhart Tolle says – “The Power of Now”.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>kalilinux</category>
      <category>linux</category>
      <category>installation</category>
    </item>
    <item>
      <title>Implement CRUD with Laravel Service-Repository Pattern</title>
      <dc:creator>saf</dc:creator>
      <pubDate>Mon, 25 May 2020 13:35:50 +0000</pubDate>
      <link>https://forem.com/saf2026/implement-crud-with-laravel-service-repository-pattern-1dkl</link>
      <guid>https://forem.com/saf2026/implement-crud-with-laravel-service-repository-pattern-1dkl</guid>
      <description>&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/jsafe00" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fdefault-green.png" alt="Buy Me A Coffee" width="434" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt; Why Laravel Service and Repository Pattern? &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Yes, indeed, there are many ways that laravel can interpret the CRUD functionality. But I personally suggest the service-repository design pattern because it’s clean and sustainable. The concept of repositories and services ensures that you write reusable code and helps to keep your controller as simple as possible making them more readable.&lt;/p&gt;

&lt;p&gt;Repositories are usually a common wrapper for your model and the place where you would write different queries in your database. A service on the other hand is a layer for handling all your application’s logic. Based on experience, it’s really conducive to separate the logic and the wrapper of the model especially when you’re working on team or big projects.&lt;/p&gt;

&lt;p&gt;To illustrate the repository and service, we’ll build a CRUD application.&lt;br&gt;
I assume you already have laravel project installed in your local machine. If none, you may read my previous post on installing laravel project at &lt;a href="https://dev.to/jsafe00/set-up-laravel-project-in-a-virtual-machine-with-laravel-homestead-3d4a"&gt;https://dev.to/jsafe00/set-up-laravel-project-in-a-virtual-machine-with-laravel-homestead-3d4a&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the purpose of this tutorial to emphasize the service-repository pattern, I’ll be illustrating the backend side only. You may use postman to execute. &lt;br&gt;
You can download then install postman here: &lt;a href="https://www.postman.com/downloads/" rel="noopener noreferrer"&gt;https://www.postman.com/downloads/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started,  let’s set up Model, Controller and Migration by executing: &lt;/p&gt;

&lt;p&gt; php artisan make:model Post -mcr &lt;/p&gt;

&lt;p&gt;-m, --migration Create a new migration file for the model.&lt;br&gt;
-c, --controller Create a new controller for the model.&lt;br&gt;
-r, --resource Indicates if the generated controller should be a resource controller&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa29x5t08hmba3s3j7vgq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa29x5t08hmba3s3j7vgq.png" alt="Alt Text" width="400" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Route &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4vyihgpnb0q9bqz5f0m8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4vyihgpnb0q9bqz5f0m8.PNG" alt="Alt Text" width="659" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Model &lt;/u&gt;&lt;/b&gt;&lt;br&gt;
Please ensure that our attributes are fillable. Update Post model like below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl0yuinzyydhciuv92dgn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl0yuinzyydhciuv92dgn.PNG" alt="Alt Text" width="480" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Migration &lt;/u&gt;&lt;/b&gt;&lt;br&gt;
Then, update the post migration like below then execute &lt;/p&gt;

&lt;p&gt; php artisan migrate &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd8n96ete3xx6a0dpcb9e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd8n96ete3xx6a0dpcb9e.PNG" alt="Alt Text" width="580" height="689"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Repository &lt;/u&gt;&lt;/b&gt;&lt;br&gt;
Laravel does not have a repository command. You have to do it manually. Just create a Repositories folder then add PostRepository file and add the code below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnxo3dati9zk77q367p8g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnxo3dati9zk77q367p8g.png" alt="Alt Text" width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We call the Post model in the constructor of our class.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Service &lt;/u&gt;&lt;/b&gt;&lt;br&gt;
Like repository, laravel doesn’t have a service command. Create a Services folder, add PostService file and add the code below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0a4eol5ilb6ytgfyqvby.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0a4eol5ilb6ytgfyqvby.PNG" alt="Alt Text" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We inject the PostRepository dependency into the constructor of our PostService class.&lt;/p&gt;

&lt;p&gt;Now that we are done with the repository-service setup. Let’s proceed with creating our CRUD.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Create &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;PostController -&amp;gt; PostService -&amp;gt; PostRepository&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/7hry719tcwbt0l0zxs4p.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/i/7hry719tcwbt0l0zxs4p.png&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqvi4u98hfv4wb6qpv5ls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqvi4u98hfv4wb6qpv5ls.png" alt="Alt Text" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;postService-&amp;gt;savePostData($data) – this part calls the savePostData function in the post service.&lt;/p&gt;

&lt;p&gt;In the post service, we validate the data. If there are no errors,&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;postRepository-&amp;gt;save($data); - we call the save function in the post repository to save the data in the database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp9qjo84eo7zgdp3vihs0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp9qjo84eo7zgdp3vihs0.PNG" alt="Alt Text" width="758" height="481"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd0kwjkylw0i7wf6yif53.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd0kwjkylw0i7wf6yif53.PNG" alt="Alt Text" width="550" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If there are errors, for example when we didn’t input a title, then this will be displayed when we execute in postman.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk5lkv6em3tv5s3kkpjmu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk5lkv6em3tv5s3kkpjmu.PNG" alt="Alt Text" width="623" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; READ &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt; GetAllData &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/zdpkcz7d7pl4kah4pvli.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/i/zdpkcz7d7pl4kah4pvli.png&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuq13tzlt36mdrq9gezgd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuq13tzlt36mdrq9gezgd.png" alt="Alt Text" width="800" height="234"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyshwvzi36lbqvf2kld6p.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyshwvzi36lbqvf2kld6p.PNG" alt="Alt Text" width="638" height="520"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frqj1992ghfql3mhv4ijn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frqj1992ghfql3mhv4ijn.PNG" alt="Alt Text" width="509" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt; GetById &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/old8umw7apwjkvkwqb58.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/i/old8umw7apwjkvkwqb58.png&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2afuwtmoy2tui7qqsxfp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2afuwtmoy2tui7qqsxfp.png" alt="Alt Text" width="800" height="225"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fojb1utpbd3ocvd68p6if.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fojb1utpbd3ocvd68p6if.PNG" alt="Alt Text" width="481" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Update &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/uddzrcqmolhupsssrk3c.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/i/uddzrcqmolhupsssrk3c.png&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbkaiwff91w1rc0f2k2dc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbkaiwff91w1rc0f2k2dc.png" alt="Alt Text" width="800" height="330"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fli7zk5yfszkk0xvebajq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fli7zk5yfszkk0xvebajq.PNG" alt="Alt Text" width="677" height="480"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2c6dhdeajtfoh7xeh7fb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2c6dhdeajtfoh7xeh7fb.PNG" alt="Alt Text" width="586" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt; Delete &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/izq5dwwy2n3fy3mmy4zk.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/i/izq5dwwy2n3fy3mmy4zk.png&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsoug59ml23sgbiwk8euh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsoug59ml23sgbiwk8euh.png" alt="Alt Text" width="800" height="265"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fltzcheow0sibqkw8i1n0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fltzcheow0sibqkw8i1n0.PNG" alt="Alt Text" width="520" height="421"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9i3f4re2qdkups7ijiw1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9i3f4re2qdkups7ijiw1.PNG" alt="Alt Text" width="514" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope by just looking at the screenshots you can already see the pattern then you can easily grasp as to why the laravel service-repository pattern is clean and sustainable. You can clone this CRUD sample at &lt;a&gt;&lt;/a&gt;&lt;a href="https://github.com/jsafe00/laravel-service-repository" rel="noopener noreferrer"&gt;https://github.com/jsafe00/laravel-service-repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have created a tutorial with interface implementation on this pattern at &lt;a href="https://josafebalili.vercel.app/laravel-service-repository-interface" rel="noopener noreferrer"&gt;https://josafebalili.vercel.app/laravel-service-repository-interface&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or you might check my CRUD implementation of repository pattern with Laravel 8 and Php 8 at &lt;a&gt;&lt;/a&gt;&lt;a href="https://github.com/jsafe00/her-running-medals-api" rel="noopener noreferrer"&gt;https://github.com/jsafe00/her-running-medals-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've created a simple package for this. You might want to check it. &lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;a href="https://github.com/jsafe00/laravel-s-r-c" rel="noopener noreferrer"&gt;https://github.com/jsafe00/laravel-s-r-c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything has a pattern, you just need to notice it. This goes with the saying that everything has beauty, but not everyone sees it.&lt;/p&gt;

&lt;p&gt;May we see beauty in everything.  Beauty is in the eye of the grateful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7j2obig24iyc64thzac2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7j2obig24iyc64thzac2.jpg" alt="Alt Text" width="620" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>service</category>
      <category>repository</category>
      <category>patterns</category>
    </item>
    <item>
      <title>Deploy Laravel application with database to Heroku</title>
      <dc:creator>saf</dc:creator>
      <pubDate>Sat, 16 May 2020 12:05:41 +0000</pubDate>
      <link>https://forem.com/saf2026/deploy-laravel-application-with-database-to-heroku-l50</link>
      <guid>https://forem.com/saf2026/deploy-laravel-application-with-database-to-heroku-l50</guid>
      <description>&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/jsafe00" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fdefault-green.png" alt="Buy Me A Coffee" width="434" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Why Heroku? &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I would like to start my blog with the question “why” as there are lots of technologies to choose from that are maybe better and more convenient to use but after all, it’s all about personal preferences.&lt;/p&gt;

&lt;p&gt;So why Heroku? &lt;/p&gt;

&lt;p&gt;Heroku is a public PaaS (Platform as a Service) provider that makes it easy to deploy applications written using several technology stacks at no cost. Application developers all around the globe use Heroku-like services to implement and test their applications remotely without any pain.&lt;br&gt;
It’s free and easy to use. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Prepare your Laravel app&lt;/u&gt;&lt;/b&gt; &lt;/p&gt;

&lt;p&gt;On this tutorial, I will use the repo : &lt;a href="https://github.com/rappasoft/laravel-boilerplate" rel="noopener noreferrer"&gt;https://github.com/rappasoft/laravel-boilerplate&lt;/a&gt;.  Laravel Boilerplate provides you with a massive head start on any size web application. It comes with a full featured access control system out of the box with an easy to learn API and is built on a Bootstrap foundation with a front and backend architecture. A big thanks to all who made contributions to this open source laravel app. Go ahead, fork and clone that repo or you can use your own depending on your preference.&lt;/p&gt;

&lt;p&gt;I assume you tested your app on local and everything worked fine before proceeding to set up the heroku.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Prepare your Heroku CLI&lt;/u&gt;&lt;/b&gt;&lt;br&gt;
You can download heroku-cli at: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install" rel="noopener noreferrer"&gt;https://devcenter.heroku.com/articles/heroku-cli#download-and-install&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Download and install Heroku according to your OS.&lt;br&gt;
Once installation is finished, go back to your terminal and try to execute:&lt;/p&gt;

&lt;p&gt;heroku login&lt;/p&gt;

&lt;p&gt;The heroku login will appear. Click login. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flksjuuq7f3bjf9zvm573.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flksjuuq7f3bjf9zvm573.JPG" alt="Alt Text" width="667" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you go back to your terminal you will see something like this:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F07mogoui8s7b3pbpx4s6.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F07mogoui8s7b3pbpx4s6.JPG" alt="Alt Text" width="641" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Create Procfile inside your main Laravel&lt;/u&gt;&lt;b&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Inside your Procfile, put this code line.&lt;br&gt;
web: vendor/bin/heroku-php-apache2 public/&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F66vxqqtzppvf2s1wxjxj.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F66vxqqtzppvf2s1wxjxj.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go back to your terminal and type:&lt;/p&gt;

&lt;p&gt;git init - This is for git initialization &lt;br&gt;
heroku create - This command will create your app and  repository name in Heroku&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5u1l9b9efxd4tt6t8zre.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5u1l9b9efxd4tt6t8zre.JPG" alt="Alt Text" width="577" height="62"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, commit and push your project to Heroku.&lt;/p&gt;

&lt;p&gt;git add .&lt;br&gt;
git commit –m “first commit”&lt;br&gt;
git push heroku master&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcgkey4eaxqao9spec0rq.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcgkey4eaxqao9spec0rq.JPG" alt="Alt Text" width="592" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, go to heroku dashboard, you will see something like this.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdd8znapw10jajefyqo3i.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdd8znapw10jajefyqo3i.JPG" alt="Alt Text" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try to access your app by clicking Open app button.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyiyorwkfjsb09stmztf7.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyiyorwkfjsb09stmztf7.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will give you a 500 server error because we have not set any configuration from our .env file on our Laravel app into Heroku.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Add Config Vars setttings in Heroku&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Click settings then add the config vars like below. Follow some config in your .env file. The APP_ENV is production while APP_URL is your heroku url. Please refer below my configuration.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F44h1uv33kjd0cxtyk82q.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F44h1uv33kjd0cxtyk82q.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffe4bx0x912bo9i96la54.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffe4bx0x912bo9i96la54.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try to access your app. You should see your app is successfully deployed now. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftzmbgpesvov3tcrnxbn3.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftzmbgpesvov3tcrnxbn3.JPG" alt="Alt Text" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Configure database&lt;/u&gt;&lt;/b&gt;&lt;br&gt;
Lastly, we will configure our database so that we can run migrations and seeders in Heroku. Actually, we can use MySQL but we need to upgrade our membership. That’s why in this tutorial, we will be using PostgreSQL because it’s free. :) &lt;/p&gt;

&lt;p&gt;Click on Resources Menu. Then search for Postgres. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd7ins5gvsjoke1yc1mp8.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd7ins5gvsjoke1yc1mp8.JPG" alt="Alt Text" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click install Heroku Postgres. After successful installation, heroku postgres is available in our dashboard resources just like below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fku9bsj588ojcqa26mw9h.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fku9bsj588ojcqa26mw9h.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, go to your terminal and type:&lt;/p&gt;

&lt;p&gt;heroku config&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F46exbxu97qw3pbg71fpt.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F46exbxu97qw3pbg71fpt.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take note on your &lt;b&gt;DATABASE_URL&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Change DATABASE_URL to the url on your heroku config.&lt;/p&gt;

&lt;p&gt;Sample Heroku config setup:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F2qcispfm5zmfwglfq9kc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2qcispfm5zmfwglfq9kc.PNG" alt="Alt Text" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set pgsql as your default database setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F7bgmpxwjcwjkpdjxto11.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7bgmpxwjcwjkpdjxto11.PNG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So far, this is the best practice I know. Please read comments section for details or share better practice you know :). &lt;/p&gt;

&lt;p&gt;Now, we will commit and push our changes in heroku repo. In your terminal run these commands below. &lt;/p&gt;

&lt;p&gt;git add .&lt;br&gt;
git commit –m “update db connection”&lt;br&gt;
git push heroku master&lt;/p&gt;

&lt;p&gt;Then, run migration in heroku. &lt;/p&gt;

&lt;p&gt;heroku run php artisan migrate&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ifzwx38tplqhwcxn73z.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ifzwx38tplqhwcxn73z.JPG" alt="Alt Text" width="362" height="625"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After migration, don’t forget to execute&lt;br&gt;
heroku run php artisan db:seed&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff8056jlo4ebxljl0wwqo.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff8056jlo4ebxljl0wwqo.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then access your heroku app &lt;/p&gt;

&lt;p&gt;&lt;a href="http://whispering-wave-57771.herokuapp.com/" rel="noopener noreferrer"&gt;http://whispering-wave-57771.herokuapp.com/&lt;/a&gt;.&lt;br&gt;
Use the email and password below to explore laravel-boilerplate.&lt;br&gt;
email: &lt;a href="mailto:admin@admin.com"&gt;admin@admin.com&lt;/a&gt;&lt;br&gt;
password: secret&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F23qxyxxuzlqv8d55kxwe.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F23qxyxxuzlqv8d55kxwe.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To rename your app, execute the ff:&lt;/p&gt;

&lt;p&gt;heroku apps:rename newname&lt;/p&gt;

&lt;p&gt;There you have it! You now have a running laravel-boilerplate app with database deployed in heroku.&lt;/p&gt;

&lt;p&gt;Hopefully this tutorial is useful to you. &lt;/p&gt;

&lt;p&gt;Ending this tutorial with something I read last night which I think is worth sharing. 🙂&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F50t89fxoom8l55ulxagg.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F50t89fxoom8l55ulxagg.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhy5bumtnljwz4pm84qco.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhy5bumtnljwz4pm84qco.JPG" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.blog/2020/05/14/the-most-successful-developers-share-more-than-they-take/" rel="noopener noreferrer"&gt;https://stackoverflow.blog/2020/05/14/the-most-successful-developers-share-more-than-they-take/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>heroku</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Set up laravel project in a virtual machine with laravel homestead</title>
      <dc:creator>saf</dc:creator>
      <pubDate>Wed, 22 Apr 2020 11:15:23 +0000</pubDate>
      <link>https://forem.com/saf2026/set-up-laravel-project-in-a-virtual-machine-with-laravel-homestead-3d4a</link>
      <guid>https://forem.com/saf2026/set-up-laravel-project-in-a-virtual-machine-with-laravel-homestead-3d4a</guid>
      <description>&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/jsafe00" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fdefault-green.png" alt="Buy Me A Coffee" width="434" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt; Why Laravel Homestead? &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine.  No more worrying about messing up your operating system! That’s why I highly recommended this virtual environment setup.&lt;/p&gt;

&lt;p&gt;Before launching your Homestead environment, you must download and install on your pc the ff:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;VirtualBox – an application that lets you run an operating system within your operating system. It keeps the data and activity of the operating system inside of it, which is called the guest operating system, separate from your regular operating system, which is called, the host operating system&lt;br&gt;
Download virtual box here: &lt;a href="https://www.virtualbox.org/wiki/Downloads" rel="noopener noreferrer"&gt;https://www.virtualbox.org/wiki/Downloads&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vagrant - tool for working with virtual environments, and in most circumstances, this means working with virtual machines. Vagrant provides a simple and easy to use command-line client for managing these environments, and an interpreter for the text-based definitions of what each environment looks like, called Vagrantfiles. Vagrant is open source, which means that anyone can download it, modify it, and share it freely.&lt;br&gt;
Download vagrant here: &lt;a href="http://www.vagrantup.com/downloads.html" rel="noopener noreferrer"&gt;http://www.vagrantup.com/downloads.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Homestead – Homestead is a vagrant package that provides a dev environment without the need to install PHP. To install homestead, you need to have a Git installed in your system. If none, download and install  Git here: &lt;a href="https://git-scm.com/downloads" rel="noopener noreferrer"&gt;https://git-scm.com/downloads&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Composer - tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. &lt;br&gt;
Download composer here: &lt;a href="https://getcomposer.org/doc/00-intro.md" rel="noopener noreferrer"&gt;https://getcomposer.org/doc/00-intro.md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I like to put my Laravel project in this directory: &lt;/p&gt;

&lt;p&gt;C:\Users\Dell&lt;/p&gt;

&lt;p&gt;In your desired directory, execute the command below:&lt;/p&gt;

&lt;p&gt; composer create-project --prefer-dist laravel/laravel Laravel &lt;/p&gt;

&lt;p&gt;Now, we have a fresh laravel project in your local machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpd8gk45cy13mai7b28aj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpd8gk45cy13mai7b28aj.png" alt="Alt Text" width="427" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the below command thru git bash in your desired directory: &lt;br&gt;
 vagrant box add laravel/homestead  &lt;/p&gt;

&lt;p&gt;You will be prompted to select your choice for &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; hyperv&lt;/li&gt;
&lt;li&gt; parallels&lt;/li&gt;
&lt;li&gt; virtualbox&lt;/li&gt;
&lt;li&gt; vmare_desktop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk34x0mms0xv408lnubbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk34x0mms0xv408lnubbn.png" alt="Alt Text" width="603" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose number 3 then press enter.&lt;/p&gt;

&lt;p&gt;Once laravel/homestead is added successfully for virtualbox, run this command: &lt;/p&gt;

&lt;p&gt; git clone &lt;a href="https://github.com/laravel/homestead.git" rel="noopener noreferrer"&gt;https://github.com/laravel/homestead.git&lt;/a&gt; Homestead &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  this will clone the homestead repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then execute the ff:&lt;/p&gt;

&lt;p&gt; bash init.sh  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  this will create the Homestead.yaml file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your Homestead.yaml file is inside your Homestead folder. Open it and configure accordingly.&lt;br&gt;
Please see below configuration. I will explain it by section. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkrsp2wg6bk9qvonjhrqa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkrsp2wg6bk9qvonjhrqa.png" alt="Alt Text" width="316" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above configuration is all about your IP address, cpus and provider of your VM. You can update it according to your desire but on my part, I’ll leave it as is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv22whqzcmm08hcnm45a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv22whqzcmm08hcnm45a6.png" alt="Alt Text" width="333" height="98"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;If you are already working with git, you may have an SSH already. But if you don’t have, please run the command below: &lt;/p&gt;

&lt;p&gt; ssh-keygen -t rsa -b 4096 -C &lt;a href="mailto:your_email@example.com"&gt;your_email@example.com&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This will create a ssh key for you and you don’t need to do anything else.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy4tgjivuziyxw2d2da7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy4tgjivuziyxw2d2da7c.png" alt="Alt Text" width="349" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the part where we specify which folders in Windows should be synchronized with the virtual machine. In my case my map is: C:/Users/Dell/Laravel since my Laravel project is in that directory and I want it to mimic in /home/vagrant/Code directory in my virtual machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgs8ssizhlbh9fazurfgc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgs8ssizhlbh9fazurfgc.png" alt="Alt Text" width="333" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This section will let us map our domain to a folder in our VM. In my case I name my domain as homestead.test then map it to /home/vagrant/code/public in my virtual machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcvkft53b0v3rq5we0i8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcvkft53b0v3rq5we0i8u.png" alt="Alt Text" width="439" height="717"&gt;&lt;/a&gt;&lt;br&gt;
This is the summary of my Homestead.yaml&lt;/p&gt;

&lt;p&gt;Don’t forget to edit your host file at: C:\Windows\System32\drivers\etc\hosts, then add this at the end of the file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2k3cy9b7rs22y8ljr0td.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2k3cy9b7rs22y8ljr0td.png" alt="Alt Text" width="591" height="424"&gt;&lt;/a&gt;&lt;br&gt;
192.168.10.10 homestead.test&lt;/p&gt;

&lt;p&gt;Go to your Homestead directory&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5v37fdr7o38kb7lz7io1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5v37fdr7o38kb7lz7io1.png" alt="Alt Text" width="249" height="39"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; cd Homestead &lt;/p&gt;

&lt;p&gt;Then run this command:&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feguv7al3r86d6uriqtcu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feguv7al3r86d6uriqtcu.png" alt="Alt Text" width="469" height="71"&gt;&lt;/a&gt;&lt;br&gt;
 vagrant up &lt;/p&gt;

&lt;p&gt;this will create the environment. If the environment was already created and the up is just resuming a machine or booting it up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4rynyks4uf782jr6nn2r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4rynyks4uf782jr6nn2r.png" alt="Alt Text" width="505" height="306"&gt;&lt;/a&gt;&lt;br&gt;
Execute vagrant ssh:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0t5oh49tfzu3cjcsatg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0t5oh49tfzu3cjcsatg1.png" alt="Alt Text" width="501" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Type cd Code then ll. The Laravel project that we have in our local machine is mimic in our vm. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs244rgvpxbka43bml3u6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs244rgvpxbka43bml3u6.png" alt="Alt Text" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can easily access our Laravel project via this address: &lt;a href="http://homestead.test" rel="noopener noreferrer"&gt;http://homestead.test&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To shut down the vagrant machine, execute the ff:&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkara57bd2k74xd7fb68o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkara57bd2k74xd7fb68o.png" alt="Alt Text" width="416" height="101"&gt;&lt;/a&gt;&lt;br&gt;
 vagrant halt &lt;/p&gt;

&lt;p&gt;Note: if you change something on your Hometead.yaml, you need to run the command:&lt;br&gt;
 vagrant reload –provision &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  vagrant reload --provision will reboot the VM and run the provision steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo90e41eq57xmkrlgcirf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo90e41eq57xmkrlgcirf.jpg" alt="Alt Text" width="236" height="236"&gt;&lt;/a&gt;&lt;br&gt;
My programming blog begins here, my Home - Laravel Homestead.  &lt;/p&gt;

&lt;p&gt;Please don't hesitate to leave a comment or ask any question to make this tutorial easily doable as possible to others.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/jsafe00" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fdefault-black.png" alt="Buy Me A Coffee" width="434" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
