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

<channel>
	<title>laravel crud operation in 5.8 Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/laravel-crud-operation-in-5-8/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/laravel-crud-operation-in-5-8/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 18 Sep 2021 13:39:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Laravel 5.8 crud operation &#8220;easy way&#8221;</title>
		<link>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-easy-way/</link>
					<comments>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-easy-way/#respond</comments>
		
		<dc:creator><![CDATA[vikashdev k]]></dc:creator>
		<pubDate>Sat, 18 Sep 2021 13:39:15 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[easy way to crud operation]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[laravel 5.8]]></category>
		<category><![CDATA[laravel crud operation in 5.8]]></category>
		<category><![CDATA[Perforce]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=9061</guid>

					<description><![CDATA[<p>Laravel:-Open source web application framework, written in PHP. Step 01 : Install Laravel 5.8 &#8220;002&#8221; is a project name and [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-easy-way/">Laravel 5.8 crud operation &#8220;easy way&#8221;</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Laravel:-Open source web application framework, written in PHP.</p>



<h3 class="wp-block-heading">Step 01 : Install Laravel 5.8</h3>



<pre class="wp-block-code"><code>composer create-project --prefer-dist laravel/laravel 002 "5.8.*"</code></pre>



<p class="wp-block-paragraph">&#8220;002&#8221; is a project name and 5.8 is a version of Laravel.</p>



<h3 class="wp-block-heading">Step 02 : Update database configuration</h3>



<h3 class="wp-block-heading">A : .env </h3>



<figure class="wp-block-image size-full is-resized"><img fetchpriority="high" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/env.png" alt="" class="wp-image-9063" width="703" height="242" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/env.png 465w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/env-300x103.png 300w" sizes="(max-width: 703px) 100vw, 703px" /></figure>



<h3 class="wp-block-heading">B : phymyadmin</h3>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/phpmyadmin.png" alt="" class="wp-image-9064" width="720" height="187" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/phpmyadmin.png 817w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/phpmyadmin-300x78.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/phpmyadmin-768x199.png 768w" sizes="(max-width: 720px) 100vw, 720px" /></figure>



<p class="wp-block-paragraph"><strong>NOTE:- Same name .env and database.</strong></p>



<h3 class="wp-block-heading">Step 03 : Make mode with -mcr</h3>



<pre class="wp-block-code"><code> php artisan make:model Today -mcr</code></pre>



<h3 class="wp-block-heading">Step 04 : Inside todays table (migrations)</h3>



<script src="https://gist.github.com/vikash-cotocus/53cf77ef79f4be171beb54b61c9b512c.js"></script>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/migrationtodays.png" alt="" class="wp-image-9065" width="690" height="380" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/migrationtodays.png 787w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/migrationtodays-300x165.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/migrationtodays-768x423.png 768w" sizes="(max-width: 690px) 100vw, 690px" /></figure>



<h3 class="wp-block-heading">Step 05 : Migrate with database </h3>



<pre class="wp-block-code"><code>php artisan migrate</code></pre>



<h3 class="wp-block-heading">Step 06 : Make blade file in resources</h3>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/view.png" alt="" class="wp-image-9066" width="499" height="453" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/view.png 459w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/view-300x273.png 300w" sizes="auto, (max-width: 499px) 100vw, 499px" /></figure>



<h3 class="wp-block-heading">Step 07 :make button in laravel dashboard  (Welcome.blade.php)</h3>



<pre class="wp-block-code"><code> &lt;a href="{{route('student')}}">&lt;button type="button" btn btn-primary>Student&lt;/button>&lt;/a></code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1009" height="338" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/button.png" alt="" class="wp-image-9067" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/button.png 1009w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/button-300x100.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/button-768x257.png 768w" sizes="auto, (max-width: 1009px) 100vw, 1009px" /></figure>



<p class="wp-block-paragraph"><strong>Route for button inside</strong> <strong>TodayController :-</strong> Route::get(&#8216;student&#8217;, &#8216;TodayController@index&#8217;)->name(&#8216;student&#8217;);</p>



<p class="wp-block-paragraph"><strong>Call blade file from index function(TodayController) </strong>:-  return view(&#8216;day.index&#8217;);</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexfile.png" alt="" class="wp-image-9068" width="706" height="270" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexfile.png 474w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexfile-300x115.png 300w" sizes="auto, (max-width: 706px) 100vw, 706px" /></figure>



<p class="wp-block-paragraph">resources->views->day-><strong>layout.blade.php</strong></p>



<script src="https://gist.github.com/vikash-cotocus/3ec9dba613735d14c8a3fe7436cf16d7.js"></script>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="551" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/layout-1024x551.png" alt="" class="wp-image-9070" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/layout-1024x551.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/layout-300x162.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/layout-768x414.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/layout-1536x827.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/layout.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">resources->views-> day-><strong>index.blade.php</strong></p>



<script src="https://gist.github.com/vikash-cotocus/ed96945593ba49e94a21e2d07b0c6f5b.js"></script>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="549" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexblade-1024x549.png" alt="" class="wp-image-9069" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexblade-1024x549.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexblade-300x161.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexblade-768x412.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexblade-1536x824.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/indexblade.png 1907w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><strong>#Make route for show data , back and submit.</strong></p>



<p class="wp-block-paragraph"><strong>Route::post(&#8216;store&#8217;, &#8216;TodayController@store&#8217;)->name(&#8216;store&#8217;);</strong> //store data</p>



<p class="wp-block-paragraph"><strong>Route::get(&#8216;show&#8217;, &#8216;TodayController@show&#8217;)->name(&#8216;show&#8217;); </strong>// show data</p>



<p class="wp-block-paragraph"><strong>Route::get(&#8216;home&#8217;, &#8216;HomeController@dashboard&#8217;)->name(&#8216;dashboard&#8217;);</strong> // back to dashboard of Laravel</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="530" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/route-1-1024x530.png" alt="" class="wp-image-9072" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/route-1-1024x530.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/route-1-300x155.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/route-1-768x397.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/route-1-1536x794.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/route-1.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><strong>Store data in data base when we hit the submit button</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="559" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/storedata-1024x559.png" alt="" class="wp-image-9074" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/storedata-1024x559.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/storedata-300x164.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/storedata-768x419.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/storedata-1536x838.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/storedata.png 1917w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<script src="https://gist.github.com/vikash-cotocus/899f6aa3e6932c96f92fac8d4c5d6be5.js"></script>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="539" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/store-1024x539.png" alt="" class="wp-image-9073" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/store-1024x539.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/store-300x158.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/store-768x404.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/store.png 1052w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 08 : Show data (when we click on show data button)</h3>



<ol class="wp-block-list"><li><strong>&lt;a href=&#8221;{{route(&#8216;show&#8217;)}}&#8221;>&lt;button type=&#8221;button&#8221; class=&#8221;btn btn-info float-right&#8221;>Show Data&lt;/button>&lt;/a></strong> // route in button </li><li><strong>Route::get(&#8216;show&#8217;, &#8216;TodayController@show&#8217;)->name(&#8216;show&#8217;);</strong> // Route (web.php)</li><li>Inside show function inside TodayController </li></ol>



<pre class="wp-block-code"><code> <strong>public function show(Today $today)
    { 
        $todays =Today::all();
       return view('day.show',compact('todays'));
    }</strong></code></pre>



<p class="wp-block-paragraph">4. Return<strong> show.blade.php </strong>With compact (<strong>all data</strong>)</p>



<script src="https://gist.github.com/vikash-cotocus/a818007d9c14dde584c64ecc5d6333ad.js"></script>



<p class="wp-block-paragraph">5. Route in <strong>edit </strong>and <strong>delete </strong>button.</p>



<p class="wp-block-paragraph"> <strong>&lt;a href=&#8221;{{route(&#8216;edit&#8217;,[&#8216;id&#8217;=> $today->id])}}&#8221;>&lt;button type=&#8221;button&#8221; class=&#8221;btn btn-primary&#8221;>edit&lt;/button>&lt;/a> </strong>// edit data</p>



<p class="wp-block-paragraph"><strong>&lt;a href=&#8221;{{route(&#8216;delete&#8217;, [&#8216;id&#8217; => $today->id])}}&#8221;>&lt;button type=&#8221;button&#8221; class=&#8221;btn btn-danger&#8221;>Delete&lt;/button>&lt;/a></strong> // delete data</p>



<h3 class="wp-block-heading">Step 09 : Edit data (edit button)</h3>



<p class="wp-block-paragraph"><strong>1.&lt;a href=&#8221;{{route(&#8216;edit&#8217;,[&#8216;id&#8217;=> $today->id])}}&#8221;>&lt;button type=&#8221;button&#8221; class=&#8221;btn btn-primary&#8221;>edit&lt;/button>&lt;/a> </strong>// edit data in edit button</p>



<p class="wp-block-paragraph"><strong>2. Route::get(&#8216;edit/{id</strong>}&#8217;, &#8216;<strong>TodayController@edit</strong>&#8216;<strong>)->name(&#8216;edit&#8217;);</strong> // edit route </p>



<p class="wp-block-paragraph"><strong>3.TodayController->edit function</strong></p>



<pre class="wp-block-code"><code> <strong>public function edit($id)
    {
        Log::info('inside edit function');
        Log::info($id);
        $today =Today::find($id);
        return view('day.edit',compact('today'));
    }</strong></code></pre>



<p class="wp-block-paragraph"><strong>4</strong>. return to blade file <strong>edit.blade.php</strong></p>



<script src="https://gist.github.com/vikash-cotocus/b4918e47ae4719a7caf97a9e7a54d53a.js"></script>



<p class="wp-block-paragraph"><strong>Submit button update function (TodayController)</strong></p>



<script src="https://gist.github.com/vikash-cotocus/adcd7e557515257c4247ba7318a10771.js"></script>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="567" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/edit-1024x567.png" alt="" class="wp-image-9075" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/edit-1024x567.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/edit-300x166.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/edit-768x426.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/edit-1536x851.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/09/edit.png 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 10 : Delete data</h3>



<script src="https://gist.github.com/vikash-cotocus/422153ed25db45509d3a2dff0f754a32.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-easy-way/">Laravel 5.8 crud operation &#8220;easy way&#8221;</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-easy-way/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
