<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Reza Amini</title>
    <description>The latest articles on DEV Community by Reza Amini (@rezaamini).</description>
    <link>https://dev.to/rezaamini</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%2F500877%2Fdc23c8f9-db9c-46a2-8ede-d11df33f7809.jpeg</url>
      <title>DEV Community: Reza Amini</title>
      <link>https://dev.to/rezaamini</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rezaamini"/>
    <language>en</language>
    <item>
      <title>Manage your Laravel migrations with 1 click!</title>
      <dc:creator>Reza Amini</dc:creator>
      <pubDate>Tue, 14 Sep 2021 17:02:48 +0000</pubDate>
      <link>https://dev.to/rezaamini/manage-your-laravel-migrations-with-1-click-1h49</link>
      <guid>https://dev.to/rezaamini/manage-your-laravel-migrations-with-1-click-1h49</guid>
      <description>&lt;p&gt;Have you ever want to migrate a single migration in Laravel?&lt;br&gt;
You need to write a huge line of words in your command line to just migrate a migration.&lt;/p&gt;

&lt;p&gt;Or have you ever tried to refresh or reset a migration?&lt;br&gt;
In some cases the migration commands literally aren't understandable and you may wonder what is the &lt;code&gt;fresh&lt;/code&gt; or &lt;code&gt;refresh&lt;/code&gt; and should I use &lt;code&gt;refresh&lt;/code&gt; or &lt;code&gt;reset&lt;/code&gt; or other commands and what is the difference between them?&lt;/p&gt;

&lt;p&gt;Imagine that you have over 10 migrations and you just want to refresh just one of them, to do this you need to execute this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan migrate:refresh &lt;span class="nt"&gt;--path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;database/migrations/2021_09_14_153949_create_products_table.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hmmm, to me and lots of you it's not enjoyable and also it does take time to write in command line and if we type the wrong name we may lose our data in database.&lt;/p&gt;

&lt;p&gt;So what should we do?&lt;/p&gt;

&lt;p&gt;Here Migrator comes!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/rezaamini-ir/migrator" rel="noopener noreferrer"&gt;Migrator&lt;/a&gt; is a GUI migration manager for Laravel.&lt;/p&gt;

&lt;p&gt;With Migrator you can manage your migration as easy as possible in a beautiful user interface.&lt;/p&gt;

&lt;p&gt;Migrator features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create new migration&lt;/li&gt;
&lt;li&gt;Migrate all migrations&lt;/li&gt;
&lt;li&gt;Fresh migrations&lt;/li&gt;
&lt;li&gt;Drop a single migration&lt;/li&gt;
&lt;li&gt;Migrate a single migration&lt;/li&gt;
&lt;li&gt;Delete and drop a migration &lt;/li&gt;
&lt;li&gt;See the status of migrations&lt;/li&gt;
&lt;li&gt;Refresh a migration (Drop then up)&lt;/li&gt;
&lt;li&gt;Show the migration data in a better way!&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;So we have talked about the features, let's install Migrator in a minute.&lt;/p&gt;

&lt;p&gt;Installing Migrator is super duper easy, you just need to run a single composer command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require rezaamini-ir/migrator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congrats! Migrator was installed successfully, now you will be to access the &lt;code&gt;/migrator&lt;/code&gt; path in your project and if you want to change the authentication method or Migrator route you can publish config file with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan vendor:publish &lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;migrator-config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then a new file will be created in your &lt;code&gt;config&lt;/code&gt; directory called: &lt;code&gt;migrator.php&lt;/code&gt; and you can change the middleware which authenticates the user and also the route of the package is editable.&lt;/p&gt;

&lt;p&gt;To read more about the Migrator package you can check out the documentation:&lt;br&gt;
&lt;a href="https://github.com/rezaamini-ir/migrator" rel="noopener noreferrer"&gt;https://github.com/rezaamini-ir/migrator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't forget to contribute to the project and Star it ⭐️ :)).&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>Boost your queries in Laravel</title>
      <dc:creator>Reza Amini</dc:creator>
      <pubDate>Fri, 16 Jul 2021 17:01:45 +0000</pubDate>
      <link>https://dev.to/rezaamini/boost-your-queries-in-laravel-2d8f</link>
      <guid>https://dev.to/rezaamini/boost-your-queries-in-laravel-2d8f</guid>
      <description>&lt;p&gt;There are lots situations which you may think that your query is super duper optimize and your project works like a Rocket!&lt;br&gt;
But when we monitor your queries which has been executed, you may be shocked and say : "Oh man, what's going on ? 31 query for just getting a bunch of articles ???? 🤐"&lt;/p&gt;

&lt;p&gt;+"It's not possible"&lt;br&gt;
-It is possible :))&lt;/p&gt;
&lt;h2&gt;
  
  
  N + 1 Problem
&lt;/h2&gt;

&lt;p&gt;First of all let me tell you about N + 1 problem, a big problem which you may not be noticed about.&lt;br&gt;
What is N + 1 Problem?&lt;/p&gt;

&lt;p&gt;Imagine you have about 30 articles and each article has a author and you want to show these articles with their author in a table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'articles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;compact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'articles'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And in your Blade :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="k"&gt;endforeach&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But if we check the queries which has been executed, we will see that over 31 queries have been executed !&lt;/p&gt;

&lt;p&gt;+Damn, whyyyyyyy?&lt;br&gt;
-Let me tell you why.&lt;/p&gt;

&lt;p&gt;When you are getting articles just one query will be executed but where are these other 30 queries ?&lt;/p&gt;

&lt;p&gt;If you remove the &lt;code&gt;&amp;lt;li&amp;gt;{{ $article-&amp;gt;author-&amp;gt;name }}&amp;lt;/li&amp;gt;&lt;/code&gt; you will back to the safe zone with just 1 executed query.&lt;/p&gt;

&lt;p&gt;This one line per each article's author run a query to get the data of author... (Oh mannnn, I got it.)&lt;/p&gt;

&lt;p&gt;Let's check the queries : &lt;br&gt;
The first query is this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`articles`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the other 30 queries are like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`authors`&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;`id`&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`authors`&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;`id`&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`authors`&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;`id`&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="c1"&gt;--.....&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`authors`&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;`id`&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Per each article's author one query will be executed.&lt;/p&gt;

&lt;h3&gt;
  
  
  With() is your saver
&lt;/h3&gt;

&lt;p&gt;Now &lt;code&gt;with&lt;/code&gt; method will be appears and save your project's life.&lt;/p&gt;

&lt;p&gt;To solve the problem you can use the &lt;code&gt;with&lt;/code&gt; method in your controller and write this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'user'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'articles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;compact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'articles'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it, nothing else needs to do :)&lt;/p&gt;

&lt;p&gt;With is solution of the N + 1 problem and it solves that with eager loading.&lt;/p&gt;

&lt;p&gt;So what is eager loading and how does it work?&lt;/p&gt;

&lt;p&gt;First lets check the queries, we had 31 queries on top and now if we check the queries we can see that just 2 queries has been executed!&lt;/p&gt;

&lt;p&gt;How just 2 queries? &lt;/p&gt;

&lt;p&gt;When we are using &lt;code&gt;eager loading&lt;/code&gt; instead of lazy load of Laravel to get authors data just one query will be executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`authors`&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nv"&gt;`id`&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And literally one query is super faster than 30 query :))&lt;/p&gt;

&lt;p&gt;Also you can get a bunch of relationship with with():&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'author'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'publisher'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you can get a nested relation:&lt;br&gt;
$articles = Article::with('author.profile')-&amp;gt;get();&lt;/p&gt;

&lt;p&gt;Wait, it isn't done, you can also filter the data which you want to return with QueryBuilder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Article&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'author.addresses'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$query&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="nv"&gt;$query&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;latest&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>laravel</category>
      <category>php</category>
      <category>sql</category>
      <category>eloqeunt</category>
    </item>
    <item>
      <title>Neat Routes in Laravel!</title>
      <dc:creator>Reza Amini</dc:creator>
      <pubDate>Tue, 23 Feb 2021 09:07:37 +0000</pubDate>
      <link>https://dev.to/rezaamini/neat-routes-in-laravel-5097</link>
      <guid>https://dev.to/rezaamini/neat-routes-in-laravel-5097</guid>
      <description>&lt;h2&gt;
  
  
  What is the Problem?
&lt;/h2&gt;

&lt;p&gt;One of the programmer's concerns is refactoring.&lt;br&gt;
Refactoring allows us to improve our code knowledge and code quality.&lt;/p&gt;

&lt;p&gt;If have been familiar with the Laravel Routing system you know there are some files in &lt;code&gt;routes/&lt;/code&gt; directory which contain some routes for our project,&lt;code&gt;api.php&lt;/code&gt; and &lt;code&gt;web.php&lt;/code&gt; are more useful than other files.&lt;/p&gt;

&lt;p&gt;When your project will grow up manage and edit these files are very harmful :(.&lt;/p&gt;

&lt;p&gt;Imagine we have a blog project which has a dashboard and admin panel and a home page for everybody.&lt;/p&gt;

&lt;p&gt;If we want to make these routes in &lt;code&gt;web.php&lt;/code&gt; file after a while we will have an unreadable file and we didn't pay attention to the first principle of SOLID which tells us to "A class should have only one reason to change".&lt;/p&gt;
&lt;h2&gt;
  
  
  So what should We do?
&lt;/h2&gt;
&lt;h3&gt;
  
  
  How routes will be registerd?
&lt;/h3&gt;

&lt;p&gt;If you check out the &lt;code&gt;app/Providers/&lt;/code&gt; directory you will see a file called &lt;code&gt;RouteServiceProvider.php&lt;/code&gt; which contains our routes and it will register our route files.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;boot&lt;/code&gt; method we have something like that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;
&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// It will register web.php route with 'web' middleware&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'web'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'routes/web.php'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;


    &lt;span class="c1"&gt;// It will register api.php route with 'api' middleware and 'api' prefix&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'api'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'api'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'routes/api.php'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;With the Route facade, we will be able to register our routes in different files.&lt;/p&gt;

&lt;p&gt;So let's do that, let's register our routes.&lt;/p&gt;

&lt;p&gt;1- Register Home Route:&lt;br&gt;
We don't need to use middleware or a special prefix for this route, so register this in &lt;code&gt;web.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;HomeController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'index'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2- Register dashboard Routes:&lt;br&gt;
First, we have to create a new file in the routes directory called &lt;code&gt;dashboard.php&lt;/code&gt; which contains our dashboard routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;DashboardController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'index'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/edit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;DashboardController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'showEdit'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/edit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;DashboardController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'storeData'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we must register this file in our service provider with a &lt;code&gt;/dashboard&lt;/code&gt; prefix and &lt;code&gt;auth&lt;/code&gt; middleware.&lt;br&gt;
Open the &lt;code&gt;RouteServiceProvider.php&lt;/code&gt; and &lt;code&gt;boot&lt;/code&gt; method, write some codes like this below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;
&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'web'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'routes/web.php'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

   &lt;span class="c1"&gt;// It will register dasboard.php route with 'api' and 'auth' middleware and 'dashboard' prefix&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'web'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auth'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'dashboard'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'routes/dasboard.php'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'api'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'api'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'routes/api.php'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Congrats! we registered our first route file :)&lt;/p&gt;

&lt;p&gt;You can make more changes based on your project.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Point: This syntax belongs to Laravel 8 and in the previous versions we had some differences, but the scenario has not changed.&lt;/code&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>Model data tracker in Laravel</title>
      <dc:creator>Reza Amini</dc:creator>
      <pubDate>Thu, 14 Jan 2021 13:29:07 +0000</pubDate>
      <link>https://dev.to/rezaamini/model-data-tracker-in-laravel-5744</link>
      <guid>https://dev.to/rezaamini/model-data-tracker-in-laravel-5744</guid>
      <description>&lt;p&gt;Have you ever tried to track your model data and see the complete data of every visit by clients?&lt;/p&gt;

&lt;p&gt;Have you ever wanted to know who sees your post and where they live?&lt;/p&gt;

&lt;p&gt;With this package, you will be able to track model data and see how many views your posts and data have.&lt;/p&gt;

&lt;p&gt;For example, you have a blog and you want to see who has seen your posts.&lt;/p&gt;

&lt;p&gt;You just need to use &lt;code&gt;Trackable&lt;/code&gt; trait in your model and say &lt;code&gt;$post-&amp;gt;track();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you are able to track your post and see who saw it with complete information like County, IP, Reefer page, and...&lt;/p&gt;

&lt;p&gt;You can see the package which is called &lt;code&gt;laravel-tracker&lt;/code&gt; in Github.&lt;/p&gt;

&lt;p&gt;Repo : &lt;a href="https://github.com/rezaamini-ir/laravel-tracker"&gt;https://github.com/rezaamini-ir/laravel-tracker&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>Make a flexible Laravel admin panel in 2 minutes!</title>
      <dc:creator>Reza Amini</dc:creator>
      <pubDate>Sun, 15 Nov 2020 18:38:27 +0000</pubDate>
      <link>https://dev.to/rezaamini/make-a-flexible-laravel-admin-panel-in-2-minutes-2128</link>
      <guid>https://dev.to/rezaamini/make-a-flexible-laravel-admin-panel-in-2-minutes-2128</guid>
      <description>&lt;p&gt;Have you ever tried to build a complete admin panel in Laravel from zero?&lt;/p&gt;

&lt;p&gt;It takes lots of energy and time and, you may not like what you have built.&lt;/p&gt;

&lt;p&gt;I had the same problem as you, When I was trying to make an admin panel and I think to myself and I said: Reza there are lots of people who want to build a beautiful admin panel like you, make your module more flexible and share It in Github.&lt;/p&gt;

&lt;p&gt;Wow, It's very good I should do it for the open-source community.&lt;/p&gt;

&lt;p&gt;So I decided to build an admin panel module and because I love Livewire I decided to do that with Livewire.&lt;/p&gt;

&lt;p&gt;If You don't know what is Livewire I should tell You It is a Fullstack framework and makes You needless from Javascript frameworks.&lt;/p&gt;

&lt;p&gt;Come on dude, don't say too much show us your package...&lt;/p&gt;

&lt;p&gt;Ok, let me tell you about &lt;a href="https://github.com/rezaamini-ir/laravel-easypanel" rel="noopener noreferrer"&gt;EasyPanel&lt;/a&gt;.&lt;br&gt;
EasyPanel is an admin panel package for Laravel and You can build your admin panel in 2 minutes (maybe less than 2 minutes).&lt;/p&gt;

&lt;p&gt;There are some features of EasyPanel : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create CRUD in the config file.&lt;/li&gt;
&lt;li&gt;Manage route prefix and addresses&lt;/li&gt;
&lt;li&gt;Beautiful UI/UX with AdminMart template&lt;/li&gt;
&lt;li&gt;Add/remove Admins with command line&lt;/li&gt;
&lt;li&gt;Every UserProviders and Authentication classes are customizable and you can change them&lt;/li&gt;
&lt;li&gt;You can create your own routes and customize our views and components&lt;/li&gt;
&lt;li&gt;Manage pagination count&lt;/li&gt;
&lt;li&gt;Multi lang&lt;/li&gt;
&lt;li&gt;Real-time validation with Livewire&lt;/li&gt;
&lt;li&gt;Customize every action in your project&lt;/li&gt;
&lt;li&gt;A small and beautiful TODO (You can disable it in your config)&lt;/li&gt;
&lt;li&gt;Create a nice and responsive view based on your data in the config file for every CRUDs&lt;/li&gt;
&lt;li&gt;Custom validation based on the config file&lt;/li&gt;
&lt;li&gt;Ajax search with Livewire in every column you want&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So We saw the features, But let's build an admin with articles section (Create, Read, Update, Delete)&lt;/p&gt;

&lt;p&gt;first of all, We must install the package (how 🤔)&lt;br&gt;
Don't be afraid It's very easy as the package name.&lt;/p&gt;

&lt;p&gt;Install the package with Composer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require rezaamini-ir/laravel-easypanel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;next, We should publish configurations and styles (Just with one command) :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan panel:install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations 👏! You have installed the package.&lt;/p&gt;

&lt;p&gt;Now We have access to the config file in &lt;code&gt;config&lt;/code&gt; directory and we can pass our cruds to &lt;code&gt;actions&lt;/code&gt; key in the &lt;code&gt;easy_panel.php&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;To create a CRUD we must pass 3 steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1- Create a CRUD config file.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create a CRUD config we must run this command out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan panel:config Article
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which Article is our model name.&lt;br&gt;
the file will be created in &lt;code&gt;resources/cruds/article.php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2- Config our CRUD file and pass the data that we want.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let's write our array in the CRUD file :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'model'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;\App\Models\Article&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="c1"&gt;// searchable field, if you dont want search feature, remove it&lt;/span&gt;
    &lt;span class="s1"&gt;'search'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'user'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;

    &lt;span class="c1"&gt;// Manage actions in crud&lt;/span&gt;
    &lt;span class="s1"&gt;'create'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'update'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'delete'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="c1"&gt;// Validation in update and create actions&lt;/span&gt;
    &lt;span class="s1"&gt;'validation'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'title'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'content'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|min:30'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="c1"&gt;// Write every fields in your db which you want to show&lt;/span&gt;
    &lt;span class="s1"&gt;'fields'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'title'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'content'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'textarea'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'image'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'file'&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="s1"&gt;'store'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'image'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'image/articles'&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="c1"&gt;//Default that data you want to pass in create and update actions, Do not you want? Delete this key.&lt;/span&gt;
    &lt;span class="s1"&gt;'extra_values'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'user_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'auth()-&amp;gt;user()-&amp;gt;id'&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="c1"&gt;// which kind of data should be showed in list page&lt;/span&gt;
    &lt;span class="s1"&gt;'show'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'image'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'user'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now we must pass 'article' value in our config file in &lt;code&gt;config/easy_panel.php&lt;/code&gt; in &lt;code&gt;actions&lt;/code&gt; key like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="s1"&gt;'actions'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'article'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'user'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3- Run CRUD creator command:&lt;/strong&gt;&lt;br&gt;
with one command We can create our CRUD action with routes and everything which a panel needs...&lt;br&gt;
&lt;code&gt;&lt;br&gt;
php artisan panel:crud article&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we have an admin panel with an Article section and a default TODO list.&lt;br&gt;
So easy 😁.&lt;/p&gt;

&lt;p&gt;Let's see what we build :&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.linkpicture.com%2Fq%2FEasypanel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.linkpicture.com%2Fq%2FEasypanel.png" alt="Admin panel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a simple example of this package and you can customize every file in your project.&lt;/p&gt;

&lt;p&gt;Repository address :&lt;br&gt;
&lt;a href="https://github.com/rezaamini-ir/laravel-easypanel" rel="noopener noreferrer"&gt;https://github.com/rezaamini-ir/laravel-easypanel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't forget to star to the package ⭐.&lt;/p&gt;

&lt;p&gt;You are free to submit a pull request :)&lt;/p&gt;

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