<?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 beginners Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/laravel-beginners/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/laravel-beginners/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:33:34 +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>Upload Document and send Mail in Laravel &#124; How to send attachment files to email using laravel ?</title>
		<link>https://www.scmgalaxy.com/tutorials/upload-document-and-send-mail-in-laravel-how-to-send-attachement-in-laravel-5-8/</link>
					<comments>https://www.scmgalaxy.com/tutorials/upload-document-and-send-mail-in-laravel-how-to-send-attachement-in-laravel-5-8/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Thu, 08 Jul 2021 13:00:36 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[attachement send in laravel]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[Laravel beginners]]></category>
		<category><![CDATA[mailtrap in laravel]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6706</guid>

					<description><![CDATA[<p>In this tutorial im going to demonstrate how to upload document and send data via Email. Please follow some easy [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/upload-document-and-send-mail-in-laravel-how-to-send-attachement-in-laravel-5-8/">Upload Document and send Mail in Laravel | How to send attachment files to email using laravel ?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph" id="64d2">In this tutorial im going to demonstrate how to upload document and send data via Email. Please follow some easy steps mentioned below.</p>



<h1 class="wp-block-heading" id="215d">First let’s go to install laravel project</h1>



<pre class="wp-block-preformatted">composer create-project laravel/laravel learning-project "5.8.*"</pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><em>lets go to&nbsp;</em><strong><em>.env folder</em></strong><em>&nbsp;and put database name and connect to database.</em></p></blockquote>



<pre class="wp-block-preformatted">DB_CONNECTION=mysql<br>DB_HOST=127.0.0.1<br>DB_PORT=3306<br>DB_DATABASE=learning-project<br>DB_USERNAME=root<br>DB_PASSWORD=</pre>



<p class="wp-block-paragraph" id="11ec">Let’s to create Controller</p>



<pre class="wp-block-preformatted">php artisan make:controller SendEmailController</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*rRkt8aw0n4w15089F6oqvQ.png" alt=""/></figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Go to your controller&nbsp;<strong><em>SendEmailController</em></strong>&nbsp;and paste below code</p></blockquote>



<pre class="wp-block-preformatted">&lt;?php<br><br>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Mail;<br>use App\Mail\SendMail;<br>use App\UploadImage;<br><br>class SendEmailController extends Controller<br>{<br><br>    function index()<br>    {<br>     return view('send_email');<br>    }<br>    public function store(Request $request){<br>        $request-&gt;validate([<br>        'name'=&gt;'required',<br>        'email' =&gt; 'required',<br>        'image'=&gt; 'required',<br>        ]);<br><br>        $resume = time() . '.' . $request['image']-&gt;getClientOriginalExtension();<br>        $imagesendbymailwithstore= new UploadImage();<br>        $imagesendbymailwithstore-&gt;name =  $request-&gt;name;<br>        $imagesendbymailwithstore-&gt;email = $request-&gt;email;<br>        $imagesendbymailwithstore-&gt;image = $resume;<br>        $imagesendbymailwithstore-&gt;save();<br><br>        // for mailling function working<br>        $imagesendbymailwithstore = array(<br>            'name' =&gt; $request-&gt;name,<br>            'email' =&gt; $request-&gt;email,<br>            'image' =&gt; 	$request-&gt;image,<br><br>        );<br>        Mail::to($imagesendbymailwithstore['email'])-&gt;send(new SendMail($imagesendbymailwithstore));<br>        $request['image']-&gt;move(base_path() . '/storage/app/public', $resume);<br>        return back()-&gt;with('success', 'Thanks for contacting us!');<br>    }<br>}</pre>



<p class="wp-block-paragraph" id="0523"><strong>Next create model and migration file so run below code.</strong></p>



<pre class="wp-block-preformatted">php artisan make:model UploadImage -m</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*Mye32YPv6VJa9H9IITbz_A.png" alt=""/></figure>



<p class="wp-block-paragraph" id="a9d3">Next step go to your migration and and table</p>



<p class="wp-block-paragraph" id="855e"><strong>database\migrations\2020_10_23_070450_create_upload_images_table.php</strong></p>



<p class="wp-block-paragraph" id="184c">Add follow column name</p>



<pre class="wp-block-preformatted">$table-&gt;string('name');<br>$table-&gt;string('email');<br>$table-&gt;string('image');</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*H_R4UWpCCuSDLzurBAkwqA.png" alt=""/></figure>



<h1 class="wp-block-heading" id="2d1b">Now migrate the table</h1>



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



<p class="wp-block-paragraph" id="1aa3">Create a Mailable class first you have to create an account in mailtrap or click this url&nbsp;<a href="https://mailtrap.io/">https://mailtrap.io/</a>&nbsp;after create account you have to copy Username: XXXXXXXXX and password: XXXXXXXXXX and put in .env file see pic</p>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/0*HVY7c4Qk1buFBt4H.png" alt=""/></figure>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/0*MDY9mF-2xxUW9_Vq.png" alt=""/></figure>



<p class="wp-block-paragraph" id="914b">Now we are ready for make mailable class for this we have to go teminal and write following</p>



<p class="wp-block-paragraph" id="43e3">Then make a view page&nbsp;<strong>send_email.blade.php</strong></p>



<pre class="wp-block-preformatted">&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br> &lt;head&gt;<br>  &lt;title&gt;  send a mail with Attachment &lt;/title&gt;<br>  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"&gt;&lt;/script&gt;<br>  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /&gt;<br>  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;<br>  &lt;style type="text/css"&gt;<br>   .box{<br>    width:600px;<br>    margin:0 auto;<br>    border:1px solid #ccc;<br>   }<br>   .has-error<br>   {<br>    border-color:#cc0000;<br>    background-color:#ffff99;<br>   }<br>  &lt;/style&gt;<br> &lt;/head&gt;<br> &lt;body&gt;<br>  &lt;br /&gt;<br>  &lt;br /&gt;<br>  &lt;br /&gt;<br>  &lt;div class="container box"&gt;<br>   &lt;h3 align="center"&gt;send a mail with Attachment using laravel 5.8&lt;/h3&gt;&lt;br /&gt;<br>   @if (count($errors) &gt; 0)<br>    &lt;div class="alert alert-danger"&gt;<br>     &lt;button type="button" class="close" data-dismiss="alert"&gt;×&lt;/button&gt;<br>     &lt;ul&gt;<br>      @foreach ($errors-&gt;all() as $error)<br>       &lt;li&gt;{{ $error }}&lt;/li&gt;<br>      @endforeach<br>     &lt;/ul&gt;<br>    &lt;/div&gt;<br>   @endif<br>   @if ($message = Session::get('success'))<br>   &lt;div class="alert alert-success alert-block"&gt;<br>    &lt;button type="button" class="close" data-dismiss="alert"&gt;×&lt;/button&gt;<br>           &lt;strong&gt;{{ $message }}&lt;/strong&gt;<br>   &lt;/div&gt;<br>   @endif<br><br>&lt;form method="post" action="{{ route('sendemail.store') }}" enctype="multipart/form-data" role="form" class="form-horizontal" id="location"&gt;<br>    {{ csrf_field() }}<br>    &lt;div class="form-group"&gt;<br>     &lt;label&gt;Enter Your Name&lt;/label&gt;<br>     &lt;input type="text" name="name" class="form-control" value="" /&gt;<br>    &lt;/div&gt;<br>    &lt;div class="form-group"&gt;<br>     &lt;label&gt;Enter Your Email&lt;/label&gt;<br>     &lt;input type="text" name="email" class="form-control" value="" /&gt;<br>    &lt;/div&gt;<br><br>    &lt;div class="form-group"&gt;<br>            &lt;label for="resume" placeholder="(resume type *PDF*)"&gt;Document:&lt;span class="text-danger font-weight-bold"&gt;*&lt;/span&gt;&lt;/label&gt;<br>            &lt;input type="file" class="w-100 p-1" name="image" value="{{old('resume')}}"/&gt;<br>            &lt;label class="text-danger mt-1" &gt;(*File type- PDF &amp; Maximum size 1 MB*)&lt;/label&gt;<br>    &lt;/div&gt;<br>    &lt;div class="form-group"&gt;<br>     &lt;input type="submit" name="send" class="btn btn-info" value="Send" /&gt;<br>    &lt;/div&gt;<br>   &lt;/form&gt;<br><br>  &lt;/div&gt;<br> &lt;/body&gt;<br>&lt;/html&gt;</pre>



<p class="wp-block-paragraph" id="c912"><strong>Next step&nbsp;</strong>make one blade page resources/view/<strong>dynamic_email_template.blade.php</strong></p>



<pre class="wp-block-preformatted">&lt;p style="margin-left:10%;"&gt;First Name - &lt;b&gt;{{ $data['name'] }} &lt;/b&gt;&lt;/p&gt;<br>&lt;p style="margin-left:10%;"&gt;last Name - &lt;b&gt;{{ $data['email'] }}  &lt;/b&gt;&lt;/p&gt;<br><br><br>&lt;p&gt;It would be appriciative, if you gone through this feedback.&lt;/p&gt;</pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Next one to create&nbsp;<strong><em>SendMail.php</em></strong>&nbsp;file run below code.</p></blockquote>



<pre class="wp-block-preformatted">php artisan make:mail SendMail</pre>



<p class="wp-block-paragraph" id="056b">Next step go to App\Mail\SendMail.php and paste below code</p>



<pre class="wp-block-preformatted">&lt;?php<br><br>namespace App\Mail;<br><br>use Illuminate\Bus\Queueable;<br>use Illuminate\Mail\Mailable;<br>use Illuminate\Queue\SerializesModels;<br>use Illuminate\Contracts\Queue\ShouldQueue;<br><br>class SendMail extends Mailable<br>{<br>    use Queueable, SerializesModels;<br>    public $imagesendbymailwithstore;<br>    /**<br>     * Create a new message instance.<br>     *<br>     * @return void<br>     */<br>    public function __construct($imagesendbymailwithstore)<br>    {<br>        $this-&gt;imagesendbymailwithstore = $imagesendbymailwithstore;<br>    }<br><br>    /**<br>     * Build the message.<br>     *<br>     * @return $this<br>     */<br>    public function build()<br>    {<br>        return $this-&gt;from('info@scmgalaxy.com')<br>        -&gt;subject('New image from Devops Team')<br>        -&gt;view('dynamic_email_template')<br>        -&gt;with('data', $this-&gt;imagesendbymailwithstore)<br>        -&gt;attach($this-&gt;imagesendbymailwithstore['image']-&gt;getRealPath(),<br>            [<br>                    'as' =&gt; $this-&gt;imagesendbymailwithstore['image']-&gt;getClientOriginalName(),<br>                'mime' =&gt; $this-&gt;imagesendbymailwithstore['image']-&gt;getClientMimeType(),<br>            ]);<br><br>    }<br>}</pre>



<p class="wp-block-paragraph" id="9452"><strong>Next define routes go to your routes/web.php file and paste below code.</strong></p>



<pre class="wp-block-preformatted">Route::get('sendemail','SendEmailController@index');<br>Route::post('sendemail.store','SendEmailController@store')-&gt;name('sendemail.store');</pre>



<p class="wp-block-paragraph" id="1c96">Now run below code and refresh your browser and fill form</p>



<pre class="wp-block-preformatted">php artisan servehttp://127.0.0.1:8000</pre>



<p class="wp-block-paragraph" id="6767">Now form look- like this</p>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*ySQoKnGCOJOULFyx9Gol5w.png" alt=""/></figure>



<p class="wp-block-paragraph" id="34da">Thanks i hope its helpfull for you <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/upload-document-and-send-mail-in-laravel-how-to-send-attachement-in-laravel-5-8/">Upload Document and send Mail in Laravel | How to send attachment files to email using laravel ?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/upload-document-and-send-mail-in-laravel-how-to-send-attachement-in-laravel-5-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Laravel and Create first View Page in Laravel ?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-install-laravel-and-create-first-view-page-in-laravel/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-install-laravel-and-create-first-view-page-in-laravel/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 06 Jul 2021 11:03:33 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[crud operation in laravel]]></category>
		<category><![CDATA[Laravel beginners]]></category>
		<category><![CDATA[laravel project setup]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6676</guid>

					<description><![CDATA[<p>In this tutorial im going to describe how to install laravel project and create first view pages, so follow some [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-install-laravel-and-create-first-view-page-in-laravel/">How to Install Laravel and Create first View Page in Laravel ?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1200/1*A42wBEcxc4L46-DO2cancg.jpeg" alt=""/></figure>



<p class="wp-block-paragraph" id="661f">In this tutorial im going to describe how to install laravel project and create first view pages, so follow some easy steps define below.</p>



<h1 class="wp-block-heading" id="cd8b">First let’s go to install laravel project</h1>



<pre class="wp-block-preformatted">composer create-project laravel/laravel learning-project "5.8.*"</pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><em>lets go to&nbsp;</em><strong><em>.env folder</em></strong><em>&nbsp;and put database name and connect to database.</em></p></blockquote>



<pre class="wp-block-preformatted">DB_CONNECTION=mysql<br>DB_HOST=127.0.0.1<br>DB_PORT=3306<br>DB_DATABASE=learning-project<br>DB_USERNAME=root<br>DB_PASSWORD=</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*iXRjngBRGaYs5_7kRwSqcQ.png" alt=""/></figure>



<h1 class="wp-block-heading" id="be24">Now migrate the table</h1>



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



<p class="wp-block-paragraph" id="c540">Now Open your project and go to Resouces/view folder and create folllowing files</p>



<pre class="wp-block-preformatted">create.blade.php<br>dashboard.blade.php<br>home.blade.php<br>blog.blade.php</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/686/1*IurixvE_OL9vn5ki_yEqvA.png" alt=""/></figure>



<p class="wp-block-paragraph" id="72ed">Go to create.blade.php and paste below code</p>



<pre class="wp-block-preformatted">&lt;h1&gt;this is create pages&lt;/h1&gt;</pre>



<p class="wp-block-paragraph" id="a62d">Next go to dashboard.blade.php and paste below code</p>



<pre class="wp-block-preformatted">&lt;h1&gt;this is dashboard pages&lt;/h1&gt;</pre>



<p class="wp-block-paragraph" id="f2b2">Now create blog.blade.php file and paste below lines.</p>



<pre class="wp-block-preformatted">&lt;h1&gt;this is blog pages&lt;/h1&gt;</pre>



<p class="wp-block-paragraph" id="6870">Next go to Route/web.php and add below line</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><em>Go to Route/web.php</em></p></blockquote>



<pre class="wp-block-preformatted">&lt;?php<br><br>/*<br>|--------------------------------------------------------------------------<br>| Web Routes<br>|--------------------------------------------------------------------------<br>|<br>| Here is where you can register web routes for your application. These<br>| routes are loaded by the RouteServiceProvider within a group which<br>| contains the "web" middleware group. Now create something great!<br>|<br>*/<br><br>Route::get('/', function () {<br>    return view('welcome');<br>});<br><br>Route::get('/dashboard', function (){<br>    return view('dashboard');<br>});<br><br>Route::get('/create', function (){<br>    return view('create');<br>});<br><br>Route::get('/blog', function (){<br>    return view('blog');<br>});</pre>



<p class="wp-block-paragraph" id="6c37">And last one serve below code in your terminal.</p>



<pre class="wp-block-preformatted">php artisan serve</pre>



<p class="wp-block-paragraph" id="3a7b">Copy below url and paste in your browser.</p>



<pre class="wp-block-preformatted"><a href="http://127.0.0.1:8000/blog">http://127.0.0.1:8000/blog</a></pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*-sXdphMWLTc4KtkfRoqg9g.png" alt=""/></figure>



<pre class="wp-block-preformatted"><a href="http://127.0.0.1:8000/blog">http://127.0.0.1:8000/c</a>reate</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*zdWOoUT7lxSIh2I9xL5jEw.png" alt=""/></figure>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/700/1*XSIz5QMu5nTwLgyC_a4iOg.png" alt=""/></figure>



<p class="wp-block-paragraph" id="620a">Thank i hope its helpfull for you. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /><a href="https://laravelamit.medium.com/?source=post_sidebar--------------------------post_sidebar-----------">Amit Kumar</a></p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-install-laravel-and-create-first-view-page-in-laravel/">How to Install Laravel and Create first View Page in Laravel ?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-install-laravel-and-create-first-view-page-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Send Email when someone Register and also send email verification</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-send-email-when-someone-register-and-also-send-email-verification/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-send-email-when-someone-register-and-also-send-email-verification/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Thu, 27 May 2021 05:24:37 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[emailverification]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[Laravel beginners]]></category>
		<category><![CDATA[verifyemail]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6390</guid>

					<description><![CDATA[<p>In this tutorial I’m going to describe how to get email verification when someone register in laravel. Please follow some [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-send-email-when-someone-register-and-also-send-email-verification/">How to Send Email when someone Register and also send email verification</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph" id="ca2a">In this tutorial I’m going to describe how to get email verification when someone register in laravel. Please follow some easy steps mentioned below.</p>



<p class="wp-block-paragraph" id="fc35">First let’s go to install laravel project</p>



<pre class="wp-block-preformatted">composer create-project laravel/laravel mail-verification "5.8.*"</pre>



<h1 class="wp-block-heading" id="9f42"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f447.png" alt="👇" class="wp-smiley" style="height: 1em; max-height: 1em;" />  Database Configuration</h1>



<p class="wp-block-paragraph" id="93dd">Setup database with your installed laravel 8 project . lets go to .env folder and put database name and connect to database.</p>



<pre class="wp-block-preformatted">DB_CONNECTION=mysql<br>DB_HOST=127.0.0.1<br>DB_PORT=3306<br>DB_DATABASE=laravel-mail<br>DB_USERNAME=root<br>DB_PASSWORD=</pre>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1366/1*y5UyFECoZUdKCMBFmSWRZg.png" alt=""/></figure>



<p class="wp-block-paragraph" id="c960">Next click on create</p>



<p class="wp-block-paragraph" id="41b5">Next set up to mail trap for getting mail</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Go to this URL —&nbsp;<a href="https://mailtrap.io/">MailTrapio</a></p></blockquote>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1366/1*ux7ee0clela9wHmwGSwVhw.png" alt=""/></figure>



<p class="wp-block-paragraph" id="61f4">Go to .env and put your mailtrap credentials</p>



<pre class="wp-block-preformatted">MAIL_MAILER=smtp<br>MAIL_HOST=smtp.mailtrap.io<br>MAIL_PORT=2525<br>MAIL_USERNAME=puthere-----<br>MAIL_PASSWORD=puthere-----<br>MAIL_ENCRYPTION=null<br>MAIL_FROM_ADDRESS=null<br>MAIL_FROM_NAME="${APP_NAME}"</pre>



<p class="wp-block-paragraph" id="36d0">Now migrate the table</p>



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



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Now Create Auth</p></blockquote>



<pre class="wp-block-preformatted">php artisan make:auth</pre>



<p class="wp-block-paragraph" id="2730"><strong>Go to App/user.php file and paste below code</strong></p>



<pre class="wp-block-preformatted">&lt;?php<br><br>namespace App;<br><br>use Illuminate\Notifications\Notifiable;<br>use Illuminate\Contracts\Auth\MustVerifyEmail;<br>use Illuminate\Foundation\Auth\User as Authenticatable;<br><br>class User extends Authenticatable implements MustVerifyEmail<br>{<br>    use Notifiable;<br><br>    /**<br>     * The attributes that are mass assignable.<br>     *<br>     * @var array<br>     */<br>    protected $fillable = [<br>        'name', 'email', 'password',<br>    ];<br><br>    /**<br>     * The attributes that should be hidden for arrays.<br>     *<br>     * @var array<br>     */<br>    protected $hidden = [<br>        'password', 'remember_token',<br>    ];<br><br>    /**<br>     * The attributes that should be cast to native types.<br>     *<br>     * @var array<br>     */<br>    protected $casts = [<br>        'email_verified_at' =&gt; 'datetime',<br>    ];<br>}</pre>



<p class="wp-block-paragraph" id="920f">Next go to Set-up Routes</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Routes/web.php</p></blockquote>



<p class="wp-block-paragraph" id="1e17">Replace Auth:Routes to below code</p>



<pre class="wp-block-preformatted">Auth::routes(['verify' =&gt; true]);</pre>



<p class="wp-block-paragraph" id="f931">Next&nbsp;go to HomeController.php file and paste below function code</p>



<pre class="wp-block-preformatted">public function __construct()<br>    {<br>        $this-&gt;middleware(['auth', 'verified']);<br>    }</pre>



<p class="wp-block-paragraph" id="2b29">Now set-up is completed run below code</p>



<pre class="wp-block-preformatted">php artisan serve</pre>



<p class="wp-block-paragraph" id="0d3d">Now page is look like this</p>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1366/1*16WAWE0Yr77Ll3hJC4esRw.png" alt=""/></figure>



<p class="wp-block-paragraph" id="3f26">Now you got successfully got verification email</p>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1366/1*iyYB0EhJqsEkKarCFnzN8A.png" alt=""/></figure>



<p class="wp-block-paragraph" id="1cc8">Now also you’ll get email when register</p>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1411/1*5xmYJnkg95uaKSYM-mXAdw.png" alt=""/></figure>



<p class="wp-block-paragraph" id="9aee">Login successfully when you verify email</p>



<figure class="wp-block-image"><img decoding="async" src="https://miro.medium.com/max/1411/1*1n0r4TJWn0j-HbXXxhb9RA.png" alt=""/></figure>



<p class="wp-block-paragraph" id="3546">Thanks i hope its helpful for you <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-send-email-when-someone-register-and-also-send-email-verification/">How to Send Email when someone Register and also send email verification</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-send-email-when-someone-register-and-also-send-email-verification/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 5.8 CRUD Tutorial with examples</title>
		<link>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-tutorial-with-examples/</link>
					<comments>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-tutorial-with-examples/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Fri, 05 Mar 2021 11:49:05 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[Laravel beginners]]></category>
		<category><![CDATA[Routes]]></category>
		<category><![CDATA[Views]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5418</guid>

					<description><![CDATA[<p>Create Route for View: To write it in a simpler way: Example:- Route::view(‘about’,’aboutme’) -We should create view in structured way(inside [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-tutorial-with-examples/">Laravel 5.8 CRUD Tutorial with examples</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Create Route for View</strong>:</p>



<pre class="wp-block-code"><code>Syntax: Route::get('uri', function(){return view('view_name')});</code></pre>



<p class="wp-block-paragraph"><strong>To write it in a simpler way:</strong></p>



<pre class="wp-block-code"><code>Syntax:- Route::view method</code></pre>



<p class="wp-block-paragraph">Example:- Route::view(‘about’,’aboutme’)</p>



<p class="wp-block-paragraph"><strong>-We should create view in structured way(inside folder) that means all the views should not be in the view folder and we can make it in structured way by making folder</strong> <strong>in views.</strong></p>



<p class="wp-block-paragraph"><strong>-To create route for view which is inside folder:</strong></p>



<pre class="wp-block-code"><code>Syntax:- Route::get(‘uri’, Function(){
return view(‘folder_name.view_name’)});</code></pre>



<p class="wp-block-paragraph">Example:- Route::get(‘aboutprofile’, Function(){return view(‘admin.profile’)});</p>



<p class="wp-block-paragraph"><strong>-Passing data from Route to view:</strong></p>



<p class="wp-block-paragraph"><strong>*</strong>Data should be in array and in key value/pair.</p>



<p class="wp-block-paragraph">*Inside the view, we can then access each value using its corresponding key.</p>



<p class="wp-block-paragraph">Example 1:-</p>



<pre class="wp-block-code"><code>Route::get(‘contact’, function(){
Return view(‘contactme’,&#91;‘name’=&gt;’Sonam’]);
});
</code></pre>



<p class="wp-block-paragraph">&nbsp;*We can also use the <em>with</em> method to add individual pieces of date to the view.</p>



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



<pre class="wp-block-code"><code>Route::get(‘contact’, function(){
return view(‘contactme’)-&gt;with(‘name’,’Sonam’)
});
</code></pre>



<p class="wp-block-paragraph"><strong>-Accessing the data which is passed from Route to view:</strong></p>



<pre class="wp-block-code"><code>&lt;h1&gt;Hello{{$name}}&lt;/h1&gt;</code></pre>



<p class="wp-block-paragraph"><strong>-Returning view from web.php using parameter:</strong></p>



<pre class="wp-block-code"><code>Route::get(‘user/(u_id}’, function($id){
Return view(‘myuser’,&#91;‘id’=&gt;$id]);
});
</code></pre>



<p class="wp-block-paragraph">(<strong>In the User View)</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;User page &lt;/h1&gt;
&lt;h1&gt;{{$id123}}&lt;/h1&gt;
&lt;/body&gt;
</code></pre>



<p class="wp-block-paragraph"><strong>-For multiple parameter:</strong></p>



<p class="wp-block-paragraph"><strong>(In web.php)</strong></p>



<pre class="wp-block-code"><code>Route::get(‘post/{post_id}/comment/{comment_id}’, function($post_id, $comment_id){
Return view(‘mypost’,&#91;‘postid’=&gt;$post_id, ‘commentid=&gt;’$comment_id’]);
});
</code></pre>



<p class="wp-block-paragraph"><strong>(In the Post View)</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;User page &lt;/h1&gt;
&lt;h1&gt;Post Id:{{$postid}}&lt;/h1&gt;
&lt;h1&gt;Comment Id:{{$commentid}}&lt;/h1&gt;
&lt;/body&gt;
</code></pre>



<p class="wp-block-paragraph"><strong>-For making optional parameter:</strong></p>



<p class="wp-block-paragraph"><strong>(In web.php)</strong></p>



<pre class="wp-block-code"><code>Route::get(‘user/(name?}’, function($name=null){
Return view(‘myuser’,&#91;‘name’=&gt;$name]);
</code></pre>



<p class="wp-block-paragraph"><strong>(In User view)</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;User page &lt;/h1&gt;
&lt;/body&gt;
</code></pre>



<p class="wp-block-paragraph">For calling this in the server we can type 127.0.0.1.8000 or 127.0.0.1.8000/name and it will display the content in both scenario without giving error. Though it will not return any name if we do not enter /name.</p>



<p class="wp-block-paragraph"><strong>-For regular expression</strong></p>



<p class="wp-block-paragraph"><strong>(In web.php)</strong></p>



<pre class="wp-block-code"><code>Route::get(‘product/{p_name}’, function($name){
Return view(‘myproduct’,&#91;name’=&gt;$name]);
})-&gt;where(‘p_name’=&gt;‘&#91;A-za-z]+’);
</code></pre>



<p class="wp-block-paragraph"><strong>(In myproduct view file)</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;Product page &lt;/h1&gt;
&lt;h1&gt;{{$name}}&lt;/h1&gt;
&lt;/body&gt;
</code></pre>



<p class="wp-block-paragraph"><strong>To redirect from one view to another view:</strong></p>



<p class="wp-block-paragraph"><strong>(In web.php)</strong></p>



<pre class="wp-block-code"><code>Route::view(‘login’, ‘mylogin’);
Route::view(‘register’,’myregister’)
Route::redirect(‘login’, ‘register’);
</code></pre>



<p class="wp-block-paragraph"><strong>(In View file)</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;Login&lt;/h1&gt;
&lt;/body&gt;
</code></pre>



<p class="wp-block-paragraph"><strong>To fallback:</strong></p>



<p class="wp-block-paragraph"><strong>(In web.php)</strong></p>



<pre class="wp-block-code"><code>Route::fallback(function(){
Return view(‘default;);
});
</code></pre>



<p class="wp-block-paragraph"><strong>In Default View:</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;Default&lt;/h1&gt;
&lt;/body&gt;
</code></pre>



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



<h2 class="has-text-align-center wp-block-heading"><strong>Controllers</strong></h2>



<p class="wp-block-paragraph"><strong>&nbsp;</strong>Controllers can group related request handling logic into a single class. Instead of defining all of your request handling logic as closures in route files, you may wish to organize this behaviour using controller classes.</p>



<p class="wp-block-paragraph">&#8211; Controllers are stored in the app/Http/Controllers</p>



<p class="wp-block-paragraph">-Controller extends the base controller class included with Laravel.</p>



<p class="wp-block-paragraph"><strong>Defining Controller Class</strong></p>



<pre class="wp-block-code"><code>Run command: php artisan make:controller controller_name</code></pre>



<p class="wp-block-paragraph">Example: php artisan make:controller AboutController</p>



<p class="wp-block-paragraph"><strong>Creating Route for Controller Class</strong></p>



<p class="wp-block-paragraph"><strong>(In AboutController.php)</strong></p>



<pre class="wp-block-code"><code>&lt;?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
	Function show(){
		Return ‘Hello Controller’;}
}
</code></pre>



<p class="wp-block-paragraph"><strong>(In Web.php)</strong></p>



<p class="wp-block-paragraph">Use App\Http\Controllers\AboutControllers;</p>



<pre class="wp-block-code"><code>Route::get(‘about’,&#91;AboutController::class,’show’]);</code></pre>



<p class="wp-block-paragraph"><strong>Syntax:</strong></p>



<pre class="wp-block-code"><code>Route::get(‘URI’,&#91;ControllerName::class,’method_name’]);</code></pre>



<p class="wp-block-paragraph"><strong>Getting parameter in Controller</strong></p>



<p class="wp-block-paragraph"><strong>In AboutController.php</strong></p>



<pre class="wp-block-code"><code>&lt;?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
	Function show(){
		Return ‘Hello Controller’,$name;}
}
</code></pre>



<p class="wp-block-paragraph"><strong>In web.php</strong></p>



<p class="wp-block-paragraph">Use App\Http\Controllers\AboutController;</p>



<pre class="wp-block-code"><code>Route::get(‘about/{name}’),&#91;AboutController::class,’show’]);</code></pre>



<p class="wp-block-paragraph"><strong>To import controller in web.php</strong></p>



<p class="wp-block-paragraph">Use App\Http\Controllers\AboutController;</p>



<p class="wp-block-paragraph"><strong>Controller returning string with parameter</strong></p>



<p class="wp-block-paragraph"><strong>In AboutController</strong></p>



<pre class="wp-block-code"><code>function show($name){
return “Hello Controller”.$name;
</code></pre>



<p class="wp-block-paragraph"><strong>In web.php</strong></p>



<pre class="wp-block-code"><code>Route::get(‘about/{name}’,&#91;Aboutcontroller::class,’show’]};</code></pre>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="576" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-1-1024x576.jpg" alt="" class="wp-image-5421" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-1-1024x576.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-1-300x169.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-1-768x432.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-1.jpg 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><strong>Returning View from Controller Class</strong></p>



<p class="wp-block-paragraph"><strong>In AboutControllers</strong></p>



<pre class="wp-block-code"><code>&lt;?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
	function show(){
		return view(‘Hello Controller’);}
}
</code></pre>



<p class="wp-block-paragraph"><strong>In web.php</strong></p>



<p class="wp-block-paragraph">Use App\Http\Controllers\AboutController;</p>



<pre class="wp-block-code"><code>Route::get(‘about’,&#91;AboutController::class,’show’]);</code></pre>



<p class="wp-block-paragraph"><strong>In Views:</strong></p>



<pre class="wp-block-code"><code>&lt;body&gt;
&lt;h1&gt;About my controller&lt;/h1&gt;
&lt;/body&gt;
</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="576" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/2-1024x576.jpg" alt="" class="wp-image-5420" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/2-1024x576.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/2-300x169.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/2-768x432.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/2.jpg 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-tutorial-with-examples/">Laravel 5.8 CRUD Tutorial with examples</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-tutorial-with-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
