<?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: Kartik Bhat</title>
    <description>The latest articles on DEV Community by Kartik Bhat (@kartikbhat).</description>
    <link>https://dev.to/kartikbhat</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%2F681860%2F926e176d-1bb6-425e-a299-e355d5369e1e.jpg</url>
      <title>DEV Community: Kartik Bhat</title>
      <link>https://dev.to/kartikbhat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kartikbhat"/>
    <language>en</language>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 8</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Tue, 24 Aug 2021 15:55:42 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-8-2na1</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-8-2na1</guid>
      <description>&lt;h3&gt;
  
  
  Laravel Routes
&lt;/h3&gt;

&lt;p&gt;I hope you understood the concept of adding data from user interface and receiving it response back to user interface,&lt;/p&gt;

&lt;p&gt;Let's revisit concept of 'routes'...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;what is 'route' ?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;simply, route is a key word that connects user interface to the backend - Controller;  :)&lt;/p&gt;

&lt;p&gt;Ok in my previous articles you saw these kinds of routes ;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;right ?&lt;/p&gt;

&lt;p&gt;(revisit web.php file and verify it once)&lt;/p&gt;

&lt;p&gt;this will connect to addData() function present under DataController Class, correct ?&lt;/p&gt;

&lt;p&gt;Hope you observed that you are using &lt;strong&gt;Route&lt;/strong&gt; Object to define new route ;&lt;/p&gt;

&lt;p&gt;this &lt;strong&gt;Route&lt;/strong&gt; object is actually defined under this class (you can notice this at the top section of the file align with &lt;em&gt;use&lt;/em&gt; keyword)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Illuminate\Support\Facades\Route;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then after that you observe key word &lt;strong&gt;get&lt;/strong&gt;; it is nothing but HTTP method; yes exactly,&lt;/p&gt;

&lt;p&gt;it will catch a type of request using a HTTP method that you used while calling that route,&lt;/p&gt;

&lt;p&gt;HTTP method is a way request rises to the application's backend ;&lt;/p&gt;

&lt;p&gt;What are different types of HTTP methods ?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GET&lt;/li&gt;
&lt;li&gt;POST&lt;/li&gt;
&lt;li&gt;PUT&lt;/li&gt;
&lt;li&gt;PATCH&lt;/li&gt;
&lt;li&gt;DELETE &lt;/li&gt;
&lt;li&gt;OPTIONS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for a time being lets concentrate on GET and POST methods only, and these are the methods we frequently use in our laravel applications.&lt;/p&gt;

&lt;p&gt;Laravel support all these kinds of methods; like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::post('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::put('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::patch('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::delete('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::options('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;along with above mentioned HTTP method routes laravel also provides another route type, it is &lt;strong&gt;any&lt;/strong&gt; , it catches any kind of HTTP method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::any('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mistyped routes/requests
&lt;/h3&gt;

&lt;p&gt;laravel matches incoming requests HTTP method first, then it finds suitable route in web.php file, if it found then control moves to controller's method; else you can observe 404 page&lt;/p&gt;

&lt;p&gt;let try this,&lt;br&gt;
You know we have a route called,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;hit this route from browser; (hope you are running laravel app)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://127.0.0.1:8000/addData" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/addData&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;you can observe this &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbp0o6g7hjc8m4evwrobd.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%2Fbp0o6g7hjc8m4evwrobd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;right ? &lt;/p&gt;

&lt;p&gt;now just alter keyword &lt;strong&gt;addData&lt;/strong&gt; to &lt;strong&gt;addData--1&lt;/strong&gt; present in the url; Ok&lt;/p&gt;

&lt;p&gt;now hit that url again;&lt;br&gt;
(Do verify that we don't have any route defined called &lt;strong&gt;addData--1&lt;/strong&gt; in our web.php file)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="http://127.0.0.1:8000/addData--1" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/addData--1&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;since we don't have any such route; laravel manages to load 404 page;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjdmwqbro2z5hlww7mv1.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%2Fcjdmwqbro2z5hlww7mv1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, no need to worry about mistyped routes/requests from browser, laravel manages it by itself, seems interesting right ? :)&lt;/p&gt;
&lt;h3&gt;
  
  
  Routes and Form submit
&lt;/h3&gt;

&lt;p&gt;whenever the form submit happens, some that will be passed to the backend from our user interface(say frontend), right ?&lt;/p&gt;

&lt;p&gt;Open &lt;strong&gt;addData.blade.php&lt;/strong&gt; file located under resources-&amp;gt;views folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div&amp;gt;
            &amp;lt;h3&amp;gt;Add Data&amp;lt;/h3&amp;gt;
            &amp;lt;form method="GET" action="{{ url('saveFormData') }}"&amp;gt;
                &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
                &amp;lt;input type="text" name="name" /&amp;gt;
                &amp;lt;label&amp;gt;Age&amp;lt;/label&amp;gt;
                &amp;lt;input type="number" name="age" /&amp;gt;
                &amp;lt;button type="submit"&amp;gt;Save&amp;lt;/button&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can observe &lt;strong&gt;method&lt;/strong&gt; and &lt;strong&gt;action&lt;/strong&gt; mentioned with form element&lt;/p&gt;

&lt;p&gt;method - GET&lt;br&gt;
action - route saveFormData&lt;/p&gt;

&lt;p&gt;here form is submitting data to the route &lt;strong&gt;saveFormData&lt;/strong&gt; via GET http method; you know it I suppose :)&lt;/p&gt;

&lt;p&gt;Now open &lt;strong&gt;DataController&lt;/strong&gt; class and go to the function returned by 'saveFormData' route; it is &lt;strong&gt;saveForm()&lt;/strong&gt;, add dd() of $request after entering the function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function saveForm(Request $request) {
        dd($request);
        $data = [
            'name' =&amp;gt; $request-&amp;gt;name,
            'age' =&amp;gt; $request-&amp;gt;age
        ];
        $insertData = Data::create($data);

        if(isset($insertData['id'])) {
            $message = "Success";
        } else {
            $message = "Failed";
        }

        $response = [
            'message'=&amp;gt;$message
        ];

        return view('response',$response);
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok, then hit the route 'addData' from your browser;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="http://127.0.0.1:8000/addData" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/addData&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;then fill the form and submit;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvzvn2fvfrxz5t6m7c33.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%2Fcvzvn2fvfrxz5t6m7c33.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see this window right ?&lt;br&gt;
Now,, just observe URL bar;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F78ypv8rz7gdzhbxql658.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%2F78ypv8rz7gdzhbxql658.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can see those form input data; those are passing as a url parameters to the backend(Controller); right ?&lt;/p&gt;

&lt;p&gt;now, lets change form method from &lt;strong&gt;GET&lt;/strong&gt; to &lt;strong&gt;POST&lt;/strong&gt; present in the file addData.blade.php&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form method="POST" action="{{ url('saveFormData') }}"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, hit the &lt;strong&gt;addData&lt;/strong&gt; route and fill the form ; then submit.&lt;/p&gt;

&lt;p&gt;What you are seeing ?&lt;/p&gt;

&lt;p&gt;this error right ?&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdpd34x82pftvydoscak.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%2Fjdpd34x82pftvydoscak.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Observe web.php file; there is no route with a method post having keyword 'saveFormData' ; Observed ?&lt;/p&gt;

&lt;p&gt;what you got ?&lt;br&gt;
route catches an http method that request is coming from; through form you are sending data through POST method for 'saveFormData'  route; it actually doesn't exist;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('saveFormData', [DataController::class,'saveForm']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it is a &lt;strong&gt;get&lt;/strong&gt; route with a key word 'saveFormData' , it doesn't catches request with POST method; then how to catch it ?&lt;/p&gt;

&lt;p&gt;Simple, create a similar route with &lt;strong&gt;post&lt;/strong&gt; method; like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::post('saveFormData', [DataController::class,'saveForm']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;that too returning same controller's same method; no issues.&lt;/p&gt;

&lt;p&gt;now again hit the url : ####&lt;a href="http://127.0.0.1:8000/addData####" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/addData####&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and fill the form and submit again;&lt;/p&gt;

&lt;p&gt;what you are seeing now ?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsq4fh54gsrxm64m9quv9.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%2Fsq4fh54gsrxm64m9quv9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you are seeing dd() response of $request; right ?&lt;/p&gt;

&lt;p&gt;Observe URL bar now; there is no url parameters exist but still Controller is receiving form data; right ?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1cjlfmbzj13ihfuzf50o.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%2F1cjlfmbzj13ihfuzf50o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what the main difference between GET and POST http methods :)&lt;/p&gt;

&lt;p&gt;POST method doesn't shows form submitted data as an URL parameters where as GET method clearly shows;&lt;/p&gt;

&lt;p&gt;There is a limitation of data length that can be passed through GET method, where POST method hasn't any such;&lt;/p&gt;

&lt;p&gt;Even though both the method has there own features; primarily we can prefer form data should be submitted through POST method, a secure approach we believe;&lt;/p&gt;

&lt;p&gt;While sending FORM data through POST we need add another constraint to the form i.e CSRF token (Cross-Site Request Forgery)&lt;br&gt;
is a way our application identifies that request is coming / data is submitting from known/authenticated source, Laravel automatically generates this CSRF token and just we need to add it within our form element&lt;/p&gt;

&lt;p&gt;within form element of the addData blade file we just need to mention&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div&amp;gt;
            &amp;lt;h3&amp;gt;Add Data&amp;lt;/h3&amp;gt;
            &amp;lt;form method="POST" action="{{ url('saveFormData') }}"&amp;gt;
                @csrf
                &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
                &amp;lt;input type="text" name="name" /&amp;gt;
                &amp;lt;label&amp;gt;Age&amp;lt;/label&amp;gt;
                &amp;lt;input type="number" name="age" /&amp;gt;
                &amp;lt;button type="submit"&amp;gt;Save&amp;lt;/button&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it will be automatically verified by laravel while receiving the request at backend;&lt;/p&gt;

&lt;p&gt;this is all about brief explanation on Laravel Routes; Hope you understood about it;&lt;/p&gt;

&lt;p&gt;Bye ;)&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 7</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Tue, 17 Aug 2021 00:01:24 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-7-1bdj</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-7-1bdj</guid>
      <description>&lt;p&gt;I hope you understood concept of interaction between controller and user interface and how blades files can be used for user interface creation.&lt;/p&gt;

&lt;p&gt;Let see, a simple user creation and sending data to controller then to model; flow,&lt;/p&gt;

&lt;p&gt;Lets Begin,&lt;/p&gt;

&lt;p&gt;first create a 'route' called &lt;strong&gt;addData&lt;/strong&gt;,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('addData', [DataController::class,'addData']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then, add addData() function in our DataController Class, it returns our blade file addData.blade.php; Ok&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; public function addData() {
    return view('addData');
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;create &lt;strong&gt;addData.blade.php&lt;/strong&gt; file under &lt;strong&gt;resources-&amp;gt;views&lt;/strong&gt; folder,&lt;br&gt;
and add this code to it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div&amp;gt;
            &amp;lt;h3&amp;gt;Add Data&amp;lt;/h3&amp;gt;
            &amp;lt;form method="GET" action="{{ url('saveFormData') }}"&amp;gt;
                &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
                &amp;lt;input type="text" name="name" /&amp;gt;
                &amp;lt;label&amp;gt;Age&amp;lt;/label&amp;gt;
                &amp;lt;input type="number" name="age" /&amp;gt;
                &amp;lt;button type="submit"&amp;gt;Save&amp;lt;/button&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;its just a simple HTML form right ? &lt;/p&gt;

&lt;p&gt;form is of &lt;strong&gt;get&lt;/strong&gt; method and it will be submitted to the route 'saveData' .&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;route can be referred using url() function inside our blade files. it then resolves full URL while loading a DOM.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now hit 'addData' route from your browser; You can see this window,&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HnJPRmA5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2leeiku6u28cfx0th0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HnJPRmA5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2leeiku6u28cfx0th0x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;right ?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;inspect (right click -&amp;gt;inspect) this page and search for &lt;em&gt;form&lt;/em&gt; element/tag, you can observe its action 'url'.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HIl5j2VA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihuqve3wqwg6eenp4qx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HIl5j2VA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihuqve3wqwg6eenp4qx2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, create an another route 'saveData' that receives the form data submitted by addData blade file,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('saveFormData', [DataController::class,'saveForm']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;create saveForm() method in our DataController Class,&lt;br&gt;
add these code to it;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function saveForm(Request $request) {
   dd($request);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe, here our method can accept $request parameter of &lt;strong&gt;Request&lt;/strong&gt; type, Laravel carries any request data in this &lt;strong&gt;Request Object&lt;/strong&gt;,&lt;/p&gt;

&lt;p&gt;to access this Request object , you need to use/add this instruction after namespace statement in our Class file, (exists by default add it if you can't find it)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Illuminate\Http\Request;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then, in saveForm() method, I have mentioned dd($request); it shows request data on our screen, Ok&lt;/p&gt;

&lt;p&gt;Fill out that form and hit save; you can see this right ?&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UGP2bnwc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b56ogoqs4wrxt2xs85dd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UGP2bnwc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b56ogoqs4wrxt2xs85dd.png" alt="RequestObject"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look into the &lt;strong&gt;request&lt;/strong&gt; index; you can observe submitted data through form, under &lt;strong&gt;parameters&lt;/strong&gt; array; Correct ?&lt;/p&gt;

&lt;p&gt;it confirms that submitted data is reaching our controller;&lt;/p&gt;

&lt;p&gt;Now, create an array that contains submitted 'name' and 'age' as its keys, in our saveForm() function. Using $request variable we can access those name and age; make dd() of that created array too,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function saveForm(Request $request) {
    $data = [
        'name' =&amp;gt; $request-&amp;gt;name,
        'age' =&amp;gt; $request-&amp;gt;age
    ];
    dd($data);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;fill out the form and save it again, you can see this window,&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sTlbdDIg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g7xrpx119orsd32twbas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sTlbdDIg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g7xrpx119orsd32twbas.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are now done with creation of an array that is required to insert data into the database&lt;a href="https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-5-2k4e"&gt;revisit if possible&lt;/a&gt; (in my one of the previous article you came across this ; but there you just added/hardcoded dummy data into the array; but now you are getting actual data from user interface)&lt;/p&gt;

&lt;p&gt;add create statement to insert it into the database;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function saveForm(Request $request) {
   $data = [
        'name' =&amp;gt; $request-&amp;gt;name,
        'age' =&amp;gt; $request-&amp;gt;age
   ];
   $insertData = Data::create($data);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$insertData holds insert status of the data(holds table inserted array/data), if it got successfully inserted then a sure $insertData contains a ky 'id' returned by database table;&lt;/p&gt;

&lt;p&gt;Let's make its dd(), to confirm about it;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function saveForm(Request $request) {
   $data = [
        'name' =&amp;gt; $request-&amp;gt;name,
        'age' =&amp;gt; $request-&amp;gt;age
   ];
   $insertData = Data::create($data);
   dd($insertData);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can see this window after refreshing/reloading our browser page (form submits again),&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IUPImK0K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58ef7o3iibaodvldk9gj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IUPImK0K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58ef7o3iibaodvldk9gj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;attributes&lt;/strong&gt; index holds the response status of the database create operation,&lt;/p&gt;

&lt;p&gt;now, if the 'id' present in the response I need to show a response message on user interface; for that I will add a logic &lt;strong&gt;isset()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;this will check whether prescribed data exist or not, returns  a Boolean true or false,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(isset($insertData['id'])) {
    $message = "Success";
} else {
    $message = "Failed";
}

$response = [
    'message'=&amp;gt;$message
];

return view('response',$response);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it will check for isset status, then if it returns true then set $message variable's  value as "Success" , else "Failed".&lt;/p&gt;

&lt;p&gt;then making this $message variable as an index of $response array and sending that to a blade file "response.blade.php".&lt;/p&gt;

&lt;p&gt;Now create a blade file called 'response.blade.php', and add this code into it;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div&amp;gt;{{ $message }}&amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is shows data present in the $message variable on our browser page,&lt;/p&gt;

&lt;p&gt;Now, Fill that form again and hit save, I hope you can see this window;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vvvu0lxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lv6t5jd6741id03cnmka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vvvu0lxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lv6t5jd6741id03cnmka.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bingo, You just submitted the form through user interface and that data got saved to the database and you got its response back to the user interface :)&lt;/p&gt;

&lt;p&gt;If you wish you can even pass 'name', 'age' indexes present in the $insertData array along with the message to show them too on your browser window. Like,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$response = [
      'message'=&amp;gt;$message,
      'name'=&amp;gt;$insertData['name'],
      'age'=&amp;gt;$insertData['age'],
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope you understood this flow of sending data from user interface and saving it into the database;&lt;/p&gt;

&lt;p&gt;Enjoyed learning it;&lt;/p&gt;

&lt;p&gt;Lets learn about concept of &lt;strong&gt;Request &amp;amp; Response&lt;/strong&gt; in my next article.&lt;/p&gt;

&lt;p&gt;Bye :)&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 6</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Sat, 14 Aug 2021 16:54:14 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-6-4pl5</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-6-4pl5</guid>
      <description>&lt;p&gt;Blade Files !!!!&lt;/p&gt;

&lt;p&gt;what are these blade files ?&lt;/p&gt;

&lt;p&gt;Cool; simply these are just HTML files, styled using CSS and made interactive using JavaScript; yes that simple.&lt;/p&gt;

&lt;p&gt;Then, Why these are called as blade files ?&lt;/p&gt;

&lt;p&gt;Ok, before that I think you already know how to infuse PHP values/variables into our html file... I suppose...&lt;/p&gt;

&lt;p&gt;using&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;?php echo $value; ?&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Correct  ?&lt;/p&gt;

&lt;p&gt;then, how to add php's logical statements in html; you suppose to know this too :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div&amp;gt;
   &amp;lt;?php
       if(a&amp;gt;b) { 
   ?&amp;gt;
      &amp;lt;b&amp;gt;&amp;lt;?php 
          echo "a is bigger" ; 
      ?&amp;gt;&amp;lt;/b&amp;gt;
      &amp;lt;?php 
       } else { 
      ?&amp;gt;
      &amp;lt;b&amp;gt;&amp;lt;?php 
        echo "b is bigger" ; 
      ?&amp;gt;&amp;lt;/b&amp;gt;
  &amp;lt;?php 
     } 
   ?&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Correct ?&lt;/p&gt;

&lt;p&gt;Don't you think these looks somewhat messy !!!&lt;br&gt;
I think it is too messy :)&lt;/p&gt;

&lt;p&gt;that's why laravel provides us a great solution, that is nothing but &lt;strong&gt;blade&lt;/strong&gt; , to make user interface development more cleaner and easier.&lt;/p&gt;

&lt;p&gt;Now, technically I can define this 'blade' as 'a template engine'; Laravel says it as 'Blade template engine', clear ?&lt;/p&gt;

&lt;p&gt;Let's see how to write above piece of code using blade engine,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.blade.php file holds any html code in it, and no need to enclose anything within &lt;strong&gt;&amp;lt;?php ?&amp;gt;&lt;/strong&gt; syntax, laravel handles it automatically.&lt;/li&gt;
&lt;li&gt;any php variable can be printed using

&lt;code&gt;{{  }}&lt;/code&gt;

syntax, add any php variable in between double flower brackets. it works similar to the &lt;strong&gt;echo&lt;/strong&gt; .&lt;/li&gt;
&lt;li&gt;logical statements such as 'if' and other statements can be infused by adding '@' before it, 
Eg:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'@if', '@elseif', '@endif', '@for', '@foreach', etc 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;any php logical statements can added similarly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&amp;lt;?php ?&amp;gt;&lt;/strong&gt; can be replaced by

&lt;code&gt;@php @endphp&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ok, Ok let's see about code;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div&amp;gt;
   @if(a&amp;gt;b)
     &amp;lt;b&amp;gt;{{ 'a is bigger' }}&amp;lt;/b&amp;gt;
   @elseif
     &amp;lt;b&amp;gt;{{ 'b is bigger' }}&amp;lt;/b&amp;gt;
   @endif
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks easy right ?&lt;/p&gt;

&lt;p&gt;these blade files reside inside a &lt;strong&gt;view&lt;/strong&gt; folder located under &lt;strong&gt;resources&lt;/strong&gt; folder (Go and check them once)&lt;/p&gt;

&lt;p&gt;from controller's method just we need to &lt;strong&gt;return&lt;/strong&gt; name of the blade file, it is enough to load that respective blade file on browser when we call that controller's method using one of the route;&lt;/p&gt;

&lt;p&gt;laravel provides a method called &lt;strong&gt;view()&lt;/strong&gt; to load a blade file on the browser, and optionally we can pass php array (key - value pair) as a second parameter to the view function, that array can be accessed in our blade file.&lt;/p&gt;

&lt;p&gt;Eg:&lt;br&gt;
assume there is a file called &lt;strong&gt;viewData.blade.php&lt;/strong&gt; present inside a &lt;strong&gt;resources-&amp;gt;views&lt;/strong&gt; folder; then we can load it from controller's method as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return view('viewData');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if we wish to pass a php array to it, then it looks like,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$data = [
   'name'=&amp;gt;'kartik'
];
return view('viewData',$data);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is to  simple one.. correct ?&lt;/p&gt;

&lt;p&gt;Come On, Lets create a blade file and try its interaction with the controller; &lt;/p&gt;

&lt;p&gt;create a file called &lt;strong&gt;viewData.blade.php&lt;/strong&gt; inside a &lt;strong&gt;resources -&amp;gt; views&lt;/strong&gt; folder&lt;/p&gt;

&lt;p&gt;copy and paste this simple html code in it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div&amp;gt;Hi, Hello&amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, lets create a controller's method to load it,&lt;br&gt;
Open our DataController file the add this method to it;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function loadPage() {
  return view('viewData');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, create a &lt;strong&gt;route&lt;/strong&gt; to call this method, &lt;br&gt;
I am sure you know that where to create it :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('loadPage', [DataController::class,'loadPage']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;again to make things easy I am keeping route name and controller method's name as same, it is not mandatory to do it every time, you are free to use any words of your wish.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  be remember route name should be unique, you cannot use same 'route' to call different methods of the controller :)
&lt;/h4&gt;

&lt;p&gt;now call 'loadPage' route from your browser; you know this one too right ?&lt;/p&gt;

&lt;p&gt;Ok, hit this url&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="http://127.0.0.1:8000/loadPage"&gt;http://127.0.0.1:8000/loadPage&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;you can see this;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yKYOyfOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2uh90tbkxuwscijyt7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yKYOyfOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2uh90tbkxuwscijyt7x.png" alt="loadPage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;seems to be a simple process right ? you just rendered a simple html file from Controller... is it ?; its a static data loading ; i.e you are not controlling the data to be displayed on browser window, its loading a string defined in a blade file itself.&lt;/p&gt;

&lt;p&gt;Let's pass a php value from our loadPage() function and display it on browser window; say a dynamic data loading ;&lt;br&gt;
you can control/customize the data to be displayed on browser window, below code says how to do it,&lt;/p&gt;

&lt;p&gt;edit your loadPage() function as ;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function loadPage() {
    $data = [
        'name' =&amp;gt; "kartik"
    ];
    return view('loadPage',$data);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;strong&gt;loadPage.blade.php&lt;/strong&gt; file and remove that 'Hi , Hello' and add&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;{{ $name }}&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
  index/key of an array $data that we have passed from loadPage() method. 'name' index of array $data can be referred as $name variable in our blade file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div&amp;gt;{{ $name }}&amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now, hit the same URL again;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kei4LUe8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3e27war24bomke412zp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kei4LUe8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3e27war24bomke412zp6.png" alt="DynamicData"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;what you are seeing ? index value that you have mentioned in loadPage() method... Correct ?&lt;/p&gt;

&lt;p&gt;Interaction between controller and blade file is not so difficult right ? I Suppose :)&lt;/p&gt;

&lt;p&gt;I hope you grasped it, in my next article let's learn about saving data to database that we will add from blade file and show them in a different page, OK&lt;/p&gt;

&lt;p&gt;Bye :)&lt;/p&gt;

</description>
      <category>laravel8</category>
      <category>mvc</category>
      <category>php</category>
    </item>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 5</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Fri, 13 Aug 2021 03:58:01 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-5-2k4e</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-5-2k4e</guid>
      <description>&lt;p&gt;Yeah, I hope you understood my previous post on creating &amp;amp; configuring a database in to our Laravel Application and accessing through Controller via Model; Ok&lt;/p&gt;

&lt;p&gt;(I believe you have some knowledge on MySQL - at least what it is; else do learn it before proceeding further)&lt;/p&gt;

&lt;p&gt;Now, let's see about accessing database table to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;insert a data&lt;/li&gt;
&lt;li&gt;read a data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;in my previous article you might noticed this instruction,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$dataValues = Data::get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will fetch all data present in the table 'data' from our database.&lt;/p&gt;

&lt;p&gt;Let's create two routes now, (you know where to do it I suppose)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;One for inserting data&lt;/li&gt;
&lt;li&gt;One for reading it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Usually, in any kind of application request raises from User Interface(a front-end) part and that request processed in the another part (a back-end)&lt;/p&gt;

&lt;p&gt;here in our laravel application, request raises from &lt;strong&gt;.blade.php&lt;/strong&gt; files(usually) then those processed in the &lt;strong&gt;Controller&lt;/strong&gt; ; a basic pinch.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Eg:  to insert a data, it usually comes from user interface to save it (a form submit :)), and also to read data , request should come from user interface itself (a page load, a button click :) ) Got ?!!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to make the concept easy here I am creating some dummy data in our controller itself and then I read it.&lt;br&gt;
(don't worry, again I will revisit a concept of getting data from user interface , saving it to the database and sending response back to user interface ;)&lt;/p&gt;

&lt;p&gt;Now, Lets create two routes,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('saveData', [DataController::class,'saveData']);

Route::get('readData', [DataController::class,'readData']);

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

&lt;/div&gt;



&lt;p&gt;I think you can define these, you are fit enough I suppose ;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;'saveData' route calls saveData() function written under DataController Class&lt;/li&gt;
&lt;li&gt;'readData' route calls readData() function written under
DataController Class&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Correct ?&lt;/p&gt;

&lt;p&gt;So, Lets write those function under DataController,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function saveData() {
      $insertData = [
          'name' =&amp;gt; 'Kartik',
          'age' =&amp;gt; 27
      ];

      $insertedData = Data::create($insertData);
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here I am creating an array $insertData, adding two indexes/keys 'name' and 'age', then adding values for those those indexes/keys, You observed it right :)&lt;/p&gt;

&lt;p&gt;then I am calling Data model's object to insert data into the database, for that I am using create() method, its a laravel feature.&lt;/p&gt;

&lt;p&gt;Notice that I am taking indexes/keys of $insertData array same as 'data' tables attributes and those should be present inside a $fillables array declared within 'Data' Model Class as well, (Open 'Data' model class and verify it once)&lt;/p&gt;

&lt;p&gt;Doubt ? Where I am taking 'id' , 'created_at' , 'updated_at' !!!&lt;br&gt;
Do I really need to add it ? &lt;br&gt;
I say no, because while creating migration of the 'data' table, I have mentioned 'id' as an &lt;strong&gt;auto incrementing&lt;/strong&gt; attribute so it will get a new value automatically when new data arises at the table then it gets incremented, then for 'created_at' and 'updated_at' attributes, laravel migration made them &lt;strong&gt;timestamp&lt;/strong&gt; values and they receive &lt;strong&gt;current timestamp&lt;/strong&gt; as there default values.&lt;/p&gt;

&lt;p&gt;It's clear right ?&lt;/p&gt;

&lt;p&gt;Ok, Now to insert data; open you browser hit an url with a route &lt;strong&gt;saveData&lt;/strong&gt; (I hope you are already running WAMP/XAMPP server and done with &lt;strong&gt;php artisan serve&lt;/strong&gt; command)&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="http://127.0.0.1:8000/saveData" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/saveData&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Hurray, data got inserted to the database;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6wh2jp0dn9qogkitz258.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%2F6wh2jp0dn9qogkitz258.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try to hit same url again, it again inserts another data with same 'name' and 'age' but different 'id'... observe that 'id' got incremented.&lt;/p&gt;

&lt;p&gt;you are seeing a blank white window !!!?&lt;/p&gt;

&lt;p&gt;Ok, let's show some status of insert operation then,&lt;/p&gt;

&lt;p&gt;in our saveData() method, after 'create' statement add ;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dd($insertedData);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;like,&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4aepjb8gu0mfkkadhml3.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%2F4aepjb8gu0mfkkadhml3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** What is this dd() !!! **&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;simply;  &lt;strong&gt;dump and die&lt;/strong&gt; :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;this method stops execution there itself and displays parameter passed to it on our browser window... simple right ?&lt;/p&gt;

&lt;p&gt;Lets try it,&lt;br&gt;
Hit same url again;&lt;br&gt;
I am assigning status of create() method to a variable called $insetedData and passing it as a parameter to the dd() method, so it show contents of $insetedData on our browser window.&lt;/p&gt;

&lt;p&gt;You can see this on your browser screen,&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu70bd8l1t9t9u3iaoexm.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%2Fu70bd8l1t9t9u3iaoexm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;open "attributes" among those data, you can observe data inserted by you along with other attributes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk16544r9sj2482bxhfsa.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%2Fk16544r9sj2482bxhfsa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bit Easy !!! correct or not ?&lt;/p&gt;

&lt;p&gt;Similarly, read data too an easy concept, let's see about it;&lt;/p&gt;

&lt;p&gt;there are some data present in the table 'data', that you have added using 'route' call, now we can list out them all;&lt;/p&gt;

&lt;p&gt;to do that; you already came across this statement !!!&lt;/p&gt;

&lt;p&gt;Yes, that is nothing but,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$fetchedData = Data::get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to view this fetched data, just do again that &lt;strong&gt;dd();&lt;/strong&gt; :)&lt;/p&gt;

&lt;p&gt;pass $fetched data array to dd(); &lt;/p&gt;

&lt;p&gt;Now, hit 'readData' route from your browser,&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  &lt;a href="http://127.0.0.1:8000/readData" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/readData&lt;/a&gt;
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;you can see this result on your browser window,&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0rkt7x9x7n96rnd0lqt.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%2Fg0rkt7x9x7n96rnd0lqt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you are seeing 3 records present in our 'data' table, correct ?&lt;br&gt;
this is too a simple one right ?&lt;/p&gt;

&lt;p&gt;Ok, Hope you understood saving and reading data from database and getting its status on our browser..&lt;/p&gt;

&lt;p&gt;Let's enter into the User Interface part in my next article, &lt;/p&gt;

&lt;p&gt;Bye :) &lt;/p&gt;

</description>
      <category>laravel8</category>
      <category>php</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 4</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Thu, 12 Aug 2021 04:42:17 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-4-16in</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-4-16in</guid>
      <description>&lt;p&gt;Ok, Hope you understood my previous post on &lt;a href="https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-3-1bjd"&gt;creating a new route and new controller&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, today I will try to explain how the controller interacts with the model&lt;/p&gt;

&lt;h3&gt;
  
  
  Model !!
&lt;/h3&gt;

&lt;p&gt;Cool, Model is nothing but an another &lt;strong&gt;.php&lt;/strong&gt; file ,  say a PHP class; where interaction with a database's table happens actually;&lt;/p&gt;

&lt;p&gt;now to interact with database table first we need to create a database and need to configure it with our Laravel application...&lt;/p&gt;

&lt;p&gt;I hope you are already running your WAMP/XAMPP server (each time while reading my post don't forgot do this in the beginning, if you server is not running)&lt;/p&gt;

&lt;p&gt;Ok, now open MySQL admin present in your server,&lt;br&gt;
in case of WAMP ; hit this URL in your browser&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  &lt;a href="http://localhost/phpmyadmin" rel="noopener noreferrer"&gt;http://localhost/phpmyadmin&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;you can see this window then,&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41v4tv2z2if6ddxwecc3.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%2F41v4tv2z2if6ddxwecc3.png" alt="PHPMYADMIN"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;by default username will be &lt;strong&gt;root&lt;/strong&gt; and password is &lt;em&gt;nothing&lt;/em&gt; (just leave it blank) hit enter (click on GO),&lt;/p&gt;

&lt;p&gt;then you will be redirected to this page;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj97sm4tm2teczlleihg9.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%2Fj97sm4tm2teczlleihg9.png" alt="PMADashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now, you need to create new database, to do that click on &lt;strong&gt;New&lt;/strong&gt;,&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftr3h2oed9si4axeyus94.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%2Ftr3h2oed9si4axeyus94.png" alt="newDBImage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will prompt you to the page where you need to mention the database name;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gf31bkbbchxuzc56l3b.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%2F2gf31bkbbchxuzc56l3b.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;enter database name as &lt;strong&gt;my-app&lt;/strong&gt; (our application name  :) )&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawdymtq8orq8jzmq5yhe.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%2Fawdymtq8orq8jzmq5yhe.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then click on &lt;strong&gt;create&lt;/strong&gt;, it will create a new database; cool :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51fb7tmv7z42pnl1qq3n.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%2F51fb7tmv7z42pnl1qq3n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hurray, you just created a new database :)&lt;/p&gt;

&lt;p&gt;Ok, Lets configure it with our Laravel app;&lt;br&gt;
Open &lt;strong&gt;.env&lt;/strong&gt; file present inside our Laravel application directory.&lt;/p&gt;

&lt;p&gt;initially it looks like this;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdz07z1c6qh524zncbbb1.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%2Fdz07z1c6qh524zncbbb1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then change value of &lt;strong&gt;DB_DATABASE&lt;/strong&gt; to ###my-app### and save :)&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cc79l8n8spmsefzvh0o.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%2F3cc79l8n8spmsefzvh0o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You were done with database configuration; Yes it is really simple :)&lt;/p&gt;

&lt;p&gt;now, you need to create a table to save some data into the created database, for that you need to create database migration file;&lt;/p&gt;

&lt;p&gt;to do that run this command in your command prompt within our Laravel application&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 make:migration create_data_table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can observe a success message too,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fga0vsmcnbf5h1t6pttd0.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%2Fga0vsmcnbf5h1t6pttd0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this will create new .php file under &lt;strong&gt;database -&amp;gt; migrations&lt;/strong&gt; folder(go and check existence of this file - current time stamp got automatically prepended to the file name)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8xph2o4o4b60vl2yf30o.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%2F8xph2o4o4b60vl2yf30o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Again , don't worry about those pre-existing migration files present there, those were created by laravel by default while installing our application&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;created migration file looks like this,&lt;br&gt;
&lt;/p&gt;

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

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDataTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('data', function (Blueprint $table) {
            $table-&amp;gt;id();
            $table-&amp;gt;timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('data');
    }
}

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

&lt;/div&gt;



&lt;p&gt;there are two methods &lt;strong&gt;up()&lt;/strong&gt; and &lt;strong&gt;down()&lt;/strong&gt;, on executing up() new table called 'data' will be created and on executing down() 'data' table will be dropped/deleted from the database if it is already exists, for now; do concentrate only on &lt;strong&gt;up()&lt;/strong&gt;,&lt;/p&gt;

&lt;p&gt;change content of &lt;strong&gt;up()&lt;/strong&gt; to ,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Schema::create('data', function (Blueprint $table) {
        $table-&amp;gt;increments('id');
        $table-&amp;gt;string('name',50);
        $table-&amp;gt;integer('age');
        $table-&amp;gt;timestamps();
 });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is required create a table called 'data' with attributes &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;auto incrementing integer primary key 'id'&lt;/li&gt;
&lt;li&gt;varchar 'name' with max length of 50&lt;/li&gt;
&lt;li&gt;integer 'age'&lt;/li&gt;
&lt;li&gt;timestamps; 'created_at' and 'updated_at'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;now it time to migrate this schema at our server, to do that run this command (refer correct file name for the data table, here file name is specific to my computer)&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 migrate --path=/database/migrations/2021_08_11_165419_create_data_table.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can observe its status,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F29h28rcfuxncz1ndhp7c.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%2F29h28rcfuxncz1ndhp7c.png" alt="dataTable"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bingo, this will create a new table called 'data' at our MySQL admin panel with those attributes mentioned above;&lt;/p&gt;

&lt;p&gt;Open MySQL admin panel, and within our 'my-app' database we can observe 'data' table got migrated/created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rlpt58his21swsg6fhq.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%2F0rlpt58his21swsg6fhq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok, You are done with database's table creation, Now it is time to create a platform to access data present in the 'data' table, for that we need to create Model File, say a PHP file/class again :)&lt;/p&gt;

&lt;p&gt;run this command to create a new Model File at &lt;strong&gt;app -&amp;gt; Models&lt;/strong&gt; folder&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 make:model Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can observe its status,&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0t0nc1mqlp5jik9bc5x.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%2Fz0t0nc1mqlp5jik9bc5x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now check this file at app-&amp;gt;Models folder, it looks like this;&lt;br&gt;
&lt;/p&gt;

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

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Data extends Model
{
    use HasFactory;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then, you need to mentions attributes of 'data' table here, after adding required attributes this file looks like,&lt;br&gt;
&lt;/p&gt;

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

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Data extends Model
{
    use HasFactory;

    protected $fillable = [
        'id',
        'name',
        'age',
        'created_at',
        'updated_at'
    ];
}

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

&lt;/div&gt;



&lt;p&gt;Ok, Everything related to database creation and its configuration with our Laravel application got completed,&lt;/p&gt;

&lt;p&gt;Now we need to call/utilize/refer this Model file/class in our Data Controller file/Class so that we can interact with the database,&lt;/p&gt;

&lt;p&gt;to do so first we need to define/use Class name of Model at our controller, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;add this anywhere after 'namespace' declaration (this is usually a first line of our PHP class, so you should add anything after this line itself)&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use App\Models\Data;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, By using Object of Class &lt;strong&gt;Data&lt;/strong&gt; (our Model Class) we can access our database table 'data' anywhere within our Controller methods.&lt;/p&gt;

&lt;p&gt;Eg :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$dataValues = Data::get()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will fetch all data present under 'data' table of our database 'my-app'&lt;/p&gt;

&lt;p&gt;usage of :: is a syntax from Laravel,&lt;/p&gt;

&lt;p&gt;Ok, This is all about accessing Database through Model in our Controller, Lets meet in the next concept on displaying a data fetched from database on our UserInterface / Browser / our blade.php file.&lt;/p&gt;

&lt;p&gt;Bye :)&lt;/p&gt;

</description>
      <category>laravel8</category>
      <category>php</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 3</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Wed, 11 Aug 2021 02:44:32 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-3-1bjd</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-3-1bjd</guid>
      <description>&lt;p&gt;I hope you tried to understand my previous post on &lt;a href="https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-jkl"&gt;laravel application structure and how it works&lt;/a&gt; in general, Today here I am providing you the code level explanation of it...&lt;/p&gt;

&lt;p&gt;You observed the word &lt;strong&gt;request&lt;/strong&gt; raised multiple times while reading about work flow of Laravel application, it goes to routes then to controller then to model and then here and then there.... ok... ok...   &lt;/p&gt;

&lt;p&gt;I think now you got a doubt regarding how that &lt;strong&gt;request&lt;/strong&gt; actually transits through these hurdles in this cycle ?&lt;/p&gt;

&lt;p&gt;Wait, I am coming there itself :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Request initiates from user interface&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;User Interface !!!&lt;br&gt;
it is nothing but executed/processed state of your HTML file, now you got it at least :), here in our terminology we call it as "VIEWS"; there is a sub folder present under resources folder (go to file structure and find it). all your so called HTML codes files exists here.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I have one point to add : Laravel, a PHP's framework here even though you are writing HTML code under views folder but still those files should contain &lt;strong&gt;.php&lt;/strong&gt; as their extension. Mind it... &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;all the files/user interface files created under views folder has an extension &lt;strong&gt;.blade.php&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  What ? .blade !!! What is this again ?
&lt;/h4&gt;

&lt;p&gt;Cool; Let know know about it soon&lt;/p&gt;

&lt;p&gt;hitting an URL, Clicking a button may a initiate a request to the application. here a &lt;strong&gt;route&lt;/strong&gt; , say a key word is used to raise a request&lt;/p&gt;

&lt;p&gt;Now again come to the main point, hit the URL provided by the command prompt.&lt;/p&gt;

&lt;p&gt;I think you got this window,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--laqGk3vv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4zabxl81ckrw8ysn3m8z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--laqGk3vv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4zabxl81ckrw8ysn3m8z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right ? now observe your URL bar : 127.0.0.1:8000 (in my case)&lt;/p&gt;

&lt;p&gt;here at the end of this address along with a '/' symbol we can call any route. (here there is no specific keyword mentioned so it goes to '/' route) &lt;/p&gt;

&lt;p&gt;did't got ? :(&lt;/p&gt;

&lt;p&gt;Ok, if you want to call/use any route, first you need to register/define it in the application.&lt;/p&gt;

&lt;p&gt;Then How to do it ?&lt;/p&gt;

&lt;p&gt;Open &lt;strong&gt;routes&lt;/strong&gt; folder under application folder the open &lt;strong&gt;web.php&lt;/strong&gt;&lt;br&gt;
it looks like,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LZoOUnIN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vyu4rhzaa6r8sgf2kfu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LZoOUnIN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vyu4rhzaa6r8sgf2kfu.png" alt="RouteFile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;here you can observe '/' route got defined !!!&lt;/p&gt;

&lt;p&gt;do not worry about &lt;strong&gt;get()&lt;/strong&gt; method, I will tell about its importance later&lt;/p&gt;

&lt;p&gt;here '/' route is returning a view called &lt;strong&gt;welcome&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;returning a view means it calls a .blade.php file located under &lt;strong&gt;resource's&lt;/strong&gt; subfolder &lt;strong&gt;views&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;route&lt;/strong&gt; can either return a &lt;strong&gt;view&lt;/strong&gt; or it can call a specific method/function defined under specific Controller i.e control/request then shifts to the Controller's method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('/', function () {
    return view('welcome');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here you can see route '/' is returning a view &lt;strong&gt;welcome&lt;/strong&gt; (no need to append &lt;strong&gt;.blade.php&lt;/strong&gt; extension to it, Laravel manages it automatically)&lt;/p&gt;

&lt;p&gt;now let see, how request got transited to controller;&lt;br&gt;
As I already said that route will again call specific method of specific controller,&lt;/p&gt;

&lt;p&gt;What is Controller then ?&lt;br&gt;
in general, Controller is authentic PHP class, a &lt;strong&gt;.php&lt;/strong&gt; file located under &lt;strong&gt;App -&amp;gt; Http -&amp;gt; Controllers&lt;/strong&gt; folder (go and check existence of this folder in your application) &lt;/p&gt;

&lt;p&gt;Why we need to controller then ?&lt;br&gt;
request received from user interface got processed in the &lt;em&gt;Controller&lt;/em&gt;, processed in the sense it either generates data or fetches data from the database with an intervention of &lt;em&gt;Model&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How to create controller ?&lt;br&gt;
open command prompt in our Laravel application folder, then enter this 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 make:controller DataController
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can observe a success message&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jSZhKAkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkax1yo0bi6h65i2pgii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jSZhKAkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkax1yo0bi6h65i2pgii.png" alt="ControllerCreated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this will create a file called DataController under App-&amp;gt; Http-&amp;gt; Controllers Folder&lt;/p&gt;

&lt;p&gt;now you need to pass controller from route to this controller's method, Ok before that write a function under DataController File (say a PHP class) , which returns a view &lt;strong&gt;welcome&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;after adding a method/function our &lt;strong&gt;DataController&lt;/strong&gt; looks like this&lt;br&gt;
&lt;/p&gt;

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

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class DataController extends Controller
{
    public function welcomeFunction() {
        return view('welcome');
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write a new route under web.php like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('welcome', 'DataController::welcomeFunction');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now our web.php file looks like this&lt;br&gt;
&lt;/p&gt;

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

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\DataController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('welcome', [DataController::class,'welcomeFunction']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;observe DataController file got defined before its usage (look at the top section of &lt;em&gt;web.php&lt;/em&gt; , DataController file called with key word &lt;strong&gt;use&lt;/strong&gt; , every controller should be call/define here first then we can use them futher... keep it in mind...)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok, Now are ready to hit new route created just now...&lt;/p&gt;

&lt;p&gt;open your browser (I hope you already running our Laravel application :) ) then hit&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;** &lt;a href="http://127.0.0.1:8000/welcome"&gt;http://127.0.0.1:8000/welcome&lt;/a&gt; **&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bingo,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5LW-8hxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj5smtfdm4fx13h83swz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5LW-8hxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj5smtfdm4fx13h83swz.png" alt="newRoute"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your new route is perfectly working... &lt;/p&gt;

&lt;p&gt;Your are seeing same window/page with both '/' and with '/welcome' routes... check them again... :)&lt;/p&gt;

&lt;p&gt;Fine, Hope you got creation of new route and new controller and its function from this article, I will be back with &lt;strong&gt;Model&lt;/strong&gt; interaction with &lt;strong&gt;Controller&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thank You&lt;/p&gt;

&lt;p&gt;Bye :)&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel8</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Laravel for Beginners : a Quick Guide - 2</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Tue, 10 Aug 2021 02:21:16 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-jkl</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-jkl</guid>
      <description>&lt;h2&gt;
  
  
  Laravel File Structure
&lt;/h2&gt;

&lt;p&gt;Hope you understood my previous post on &lt;a href="https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-47mh"&gt;Laravel's introduction and its installation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now Let's see, how the installed &lt;strong&gt;Laravel&lt;/strong&gt; folder looks alike and what each subfolder says...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7O5ff4pM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljtwdae3uc7rdftdtyoa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7O5ff4pM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljtwdae3uc7rdftdtyoa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;in this articles it is sufficient, if you understand only a  importance of the each subfolder you see, again in the upcoming article I will revisit each folder wherever it is necessary... Don't worry about it.. :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok let's start,&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  app
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;it is a core part of our Laravel application, major part of the development happens here, so keep in mind this folder play a key role every time.&lt;br&gt;
it has 5 subfolder by default (we can create our subfolder too as a need of customization)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Console&lt;/li&gt;
&lt;li&gt;Exceptions&lt;/li&gt;
&lt;li&gt;HTTP - very important !!! (it holds all business logic - a controller files under Controllers sub folder)&lt;/li&gt;
&lt;li&gt;Models - very important too !! (it holds all database connecting related files)&lt;/li&gt;
&lt;li&gt;Providers - somehow important too :)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  bootstrap
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;it is a folder where application's cache data resides, for now no need to worry about it much, OK&lt;br&gt;
it has one subfolder&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cache&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  config
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;config is one among important folders under Laravel application folder, where all the configurations related to application were defined, Keep it in mind... &lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  database
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;database folder has a role with respect to database operations of the application, it holds data creation factory files, database table migrations and data seeding logic... &lt;br&gt;
Again Don't worry I will revisit this folder in depth... :) &lt;/p&gt;

&lt;p&gt;it has three subfolders in it&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;factories&lt;/li&gt;
&lt;li&gt;migrations&lt;/li&gt;
&lt;li&gt;seeders&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  public
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;ohho.... its a public place :)&lt;br&gt;
cool : , I means all publicly accessible files were kept here so that application can access these at any time while execution. I hope its enough as of now... I will speak about it again.. :)&lt;/p&gt;

&lt;p&gt;it contains folder like js, css, images etc&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  resources
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;its a place where all the expected resources of the application lies, as of now you just remember this folder holds all User Interface related files (your html files - under views subfolder)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  routes
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;this folder holds those files, which defines a route; say a &lt;em&gt;key word&lt;/em&gt; by how interaction with an application can be achieved, in generally route is an entry point to the application or to its functionality. As of now just concentrate on &lt;em&gt;web.php&lt;/em&gt; file under this folder.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  storage
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;this folder holds those files generated by framework, a place where we can get logs related to application's run time behaviour and application uses it to cache some data too...&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  tests
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;As laravel provides automated tests; this folder is meant to save those all; ok it is not so important as of now.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  vendors
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;this folder too an important folder among others, it holds all the data of installed/added/adopted third party libraries/plugins, specifically a laravel plugins... &lt;/p&gt;

&lt;p&gt;Ok, apart from these; under Laravel folder there is another factor to mention that is &lt;strong&gt;.env&lt;/strong&gt; file&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;.env&lt;/strong&gt; file&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;it an important file where primary configurations of the application resides, it says about many factors that our Laravel application can easily access.&lt;/p&gt;

&lt;p&gt;then we have&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;composer.json&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;this is too an important file, which says about installed third party libraries and their versions, connects our application to the &lt;em&gt;composer&lt;/em&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  How Laravel Application Works
&lt;/h2&gt;

&lt;p&gt;now, after visiting file structure of our application, you may rise a point how actually it works or it runs/executes ?&lt;br&gt;
let's see that concept...&lt;/p&gt;

&lt;p&gt;after running the application through command prompt you will get an url, Ok hit that &lt;strong&gt;url&lt;/strong&gt; in your browser...&lt;/p&gt;

&lt;p&gt;Wait, Let me explain this diagrammatically,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nb5q6du6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17ggyt8otgjq6s0mhaqa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nb5q6du6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17ggyt8otgjq6s0mhaqa.png" alt="HowLaravelWorks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;

&lt;p&gt;What You got ? Any hint..... :) &lt;br&gt;
Ok, in simple words, Browser connected to route, route connected to controller , controller connected to model and browser, then finally model connected to the database... right ? I hope you grasped these at least,&lt;/p&gt;

&lt;p&gt;Ok technically I can redefine it as - Browser requests through the route, route then requests to controller, controller interacts with the model and model interacts with the database.&lt;/p&gt;

&lt;p&gt;More Specifically, request raises from &lt;strong&gt;user interface&lt;/strong&gt;(browser page) &lt;br&gt;
by calling the &lt;strong&gt;route&lt;/strong&gt;, then &lt;strong&gt;route&lt;/strong&gt; shifts the control to the &lt;strong&gt;controller&lt;/strong&gt;, then &lt;strong&gt;controller&lt;/strong&gt; deals with request either processes data or interacts with &lt;strong&gt;model&lt;/strong&gt; to read/write/update/delete operations, then &lt;strong&gt;model&lt;/strong&gt; actually executes controller's expected operations with &lt;strong&gt;database&lt;/strong&gt; then responds back the status to the &lt;strong&gt;controller&lt;/strong&gt;, then controller responds back to the &lt;strong&gt;user interface&lt;/strong&gt;, this as a whole we can call it as MVC interaction.&lt;/p&gt;

&lt;p&gt;Ok, Lets see about conceptualizing of M-V-C on code level in my next article.&lt;/p&gt;

&lt;p&gt;Hope you understood little about these...&lt;/p&gt;

&lt;p&gt;Thank You&lt;br&gt;
Bye :) &lt;/p&gt;

</description>
      <category>php</category>
      <category>mvc</category>
      <category>laravel8</category>
    </item>
    <item>
      <title>Laravel for Beginners  : a Quick Guide - 1</title>
      <dc:creator>Kartik Bhat</dc:creator>
      <pubDate>Sun, 08 Aug 2021 16:03:03 +0000</pubDate>
      <link>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-47mh</link>
      <guid>https://dev.to/kartikbhat/laravel-for-beginners-a-quick-guide-47mh</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;a href="https://laravel.com/"&gt;Laravel&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
PHP’s MVC framework, say a popular one too&lt;/p&gt;

&lt;p&gt;It is developed by &lt;a href="https://twitter.com/taylorotwell"&gt;Taylor Otwell&lt;/a&gt;, thank him for making our web development somewhat easier, its current version is 8.x&lt;/p&gt;

&lt;h3&gt;
  
  
  What you need before dive into it?
&lt;/h3&gt;

&lt;p&gt;Cool :) &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;basics of HTML, CSS, JS and PHP is enough (I hope you know these at least or learn them first)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I am sure developing web application using Laravel is easy (hope so) and interesting too :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Laravel is a PHP Framework
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What is Framework?
&lt;/h3&gt;

&lt;p&gt;Simply, a set of pre-developed files that makes our development easier and faster, we develop-&amp;gt;code our ideas on top of these files...&lt;/p&gt;

&lt;h3&gt;
  
  
  Why we need Framework?
&lt;/h3&gt;

&lt;p&gt;Reduces development time, avoid developing simple components too, then finally we can get relief from scratching our head for managing data flow between multiple files ( but of course frequently we need to scratch our head for logical reasons :| )&lt;/p&gt;

&lt;p&gt;If you feel &lt;strong&gt;you are creative&lt;/strong&gt; - &lt;strong&gt;you have patience&lt;/strong&gt; - &lt;strong&gt;eager to explore&lt;/strong&gt; then for a sure Laravel thrills you...&lt;/p&gt;

&lt;p&gt;Lets Begin,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Laravel follows a MVC architecture&lt;/strong&gt; ...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What is MVC?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MVC is an architecture where Database Operations - Business Logic - View (visual representation) were kept separately.&lt;/li&gt;
&lt;li&gt;It makes code readability easier &lt;/li&gt;
&lt;li&gt;also makes our work easier too :)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;MVC - Model - View - Controller&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Model - Place to write all database related code&lt;/li&gt;
&lt;li&gt;View - Where we write UI related code&lt;/li&gt;
&lt;li&gt;Controller - Holds an actual logical part, acts as a mediator between Model and View&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;System Requirements&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Apache Server - install either &lt;a href="https://www.wampserver.com/en/"&gt;WAMP&lt;/a&gt; (easier) /&lt;a href="https://www.apachefriends.org/download.html"&gt;XAMPP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://getcomposer.org/"&gt;Composer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Browser&lt;/li&gt;
&lt;li&gt;IDE - I prefer &lt;a href="https://code.visualstudio.com/download"&gt;VSCode&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;

&lt;p&gt;I hope you were done with installation :)&lt;/p&gt;

&lt;p&gt;then to run server&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  If you are using WAMP
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;just double click on &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AdflabM5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpahp656xbbckgj6kt5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AdflabM5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpahp656xbbckgj6kt5o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can observe the transition status of WAMP server&lt;br&gt;
Starting/Error - &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NY132ehA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b6cnbvxm19cxhlyk9hkv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NY132ehA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b6cnbvxm19cxhlyk9hkv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Partially Completed - &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_vJvxxjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e4kiosowavo8ckmanrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_vJvxxjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e4kiosowavo8ckmanrn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Started Successfully - &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RKTv8IqM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhqrx0l4twdftchj3chg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RKTv8IqM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhqrx0l4twdftchj3chg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  If you are using XAMPP
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;just double click on &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RDRdxinz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.utdstc.com/icon/52b/ca7/52bca7c3ba7b1ee97913ca068d5e1d08d64806ecd6a979d4f96eef63d1254c92:200" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RDRdxinz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.utdstc.com/icon/52b/ca7/52bca7c3ba7b1ee97913ca068d5e1d08d64806ecd6a979d4f96eef63d1254c92:200" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then within its interface &lt;strong&gt;start&lt;/strong&gt; Apache and MySQL&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lcHemEDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.filehorse.com/screenshots/developer-tools/xampp-screenshot-01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lcHemEDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.filehorse.com/screenshots/developer-tools/xampp-screenshot-01.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  then open browser hit  &lt;strong&gt;&lt;a href="http://localhost"&gt;http://localhost&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;if a page related &lt;br&gt;
to WAMP/XAMPP loads properly then it is clear that server started properly else there might be some problems with your system&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  open &lt;strong&gt;cmd&lt;/strong&gt; - a command prompt and enter &lt;strong&gt;composer&lt;/strong&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;if it shows like this &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O7x0l6ag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9np1b4pbisdz1t28zmes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O7x0l6ag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9np1b4pbisdz1t28zmes.png" alt="Composer Message"&gt;&lt;/a&gt;&lt;br&gt;
it justifies that composer got installed successfully&lt;/p&gt;

&lt;p&gt;Got Tired after these steps :(&lt;br&gt;
Don't worry you are just one step away from &lt;strong&gt;Laravel&lt;/strong&gt; installation...&lt;/p&gt;

&lt;p&gt;come lets do that one too :)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open command prompt at you desired location in your system&lt;/li&gt;
&lt;li&gt;Now you are installing LARAVEL through using composer&lt;/li&gt;
&lt;li&gt;enter a command &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;composer create-project laravel/laravel my-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;wait for a while to install all necessary dependencies&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;then, Bingo&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;LARAVEL got installed, then you can see these messages&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iKLwpucp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5lfh9devp8iwatxchrb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iKLwpucp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5lfh9devp8iwatxchrb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Then How to run this Application ?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That too still simple,&lt;/p&gt;

&lt;p&gt;open command prompt inside a created laravel project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DkzIq-n4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht3yiun9eprkze21eibl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DkzIq-n4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ht3yiun9eprkze21eibl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then enter &lt;br&gt;
&lt;code&gt;php artisan serve&lt;/code&gt;&lt;br&gt;
You will get an URL, where our Laravel app is running&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SDUkfcs6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0t9e6wcmxrl2dxm94y5f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SDUkfcs6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0t9e6wcmxrl2dxm94y5f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok... the last step :) &lt;br&gt;
last one...&lt;/p&gt;

&lt;p&gt;open the browser then hit the URL provided in a cmd propmt...&lt;/p&gt;

&lt;p&gt;Hurray !!!!!&lt;/p&gt;

&lt;p&gt;Our Laravel Application is running&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WZShDsEp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nja3i35yk3qli1w6oooa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WZShDsEp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nja3i35yk3qli1w6oooa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enough for now right!!!... Ok&lt;/p&gt;

&lt;p&gt;I hope you gained some hint on &lt;strong&gt;What is Laravel?&lt;/strong&gt; and &lt;strong&gt;How to install it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lets meet in the next topic on Laravel Application Structure and how MVC induced in it...&lt;/p&gt;

&lt;p&gt;Bye :) &lt;/p&gt;

</description>
      <category>php</category>
      <category>mvc</category>
      <category>laravel8</category>
    </item>
  </channel>
</rss>
