<?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>Codeplaners</title>
	<atom:link href="https://codeplaners.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/</link>
	<description>Code Solution</description>
	<lastBuildDate>Thu, 31 Jul 2025 02:39:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>Codeplaners</title>
	<link>https://codeplaners.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Laravel Macro Methods</title>
		<link>https://codeplaners.com/laravel-macro-methods/</link>
					<comments>https://codeplaners.com/laravel-macro-methods/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 31 Jul 2025 02:39:51 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 12]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1798</guid>

					<description><![CDATA[<p>अगर आप Laravel developer हैं, तो आप ने Service Providers, Facades, और Helper functions तो जरूर use किए होंगे। लेकिन क्या आपने कभी Laravel Macros के बारे में सुना है? Macro एक कम-ज्ञात लेकिन बहुत powerful फीचर है जो आपको Laravel की existing core classes जैसे Str, Collection, Request वगैरह में custom methods जोड़ने की &#8230; <a href="https://codeplaners.com/laravel-macro-methods/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel Macro Methods"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-macro-methods/">Laravel Macro Methods</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>अगर आप Laravel developer हैं, तो आप ने <strong>Service Providers</strong>, <strong>Facades</strong>, और <strong>Helper functions</strong> तो जरूर use किए होंगे। लेकिन क्या आपने कभी <strong>Laravel Macros</strong> के बारे में सुना है?</p>
<p>Macro एक कम-ज्ञात लेकिन बहुत powerful फीचर है जो आपको Laravel की existing core classes जैसे <code>Str</code>, <code>Collection</code>, <code>Request</code> वगैरह में custom methods जोड़ने की सुविधा देता है — बिना core को override किए।</p>
<h2>Laravel Macro क्या होता है?</h2>
<p><strong>Macro</strong> का मतलब है: “किसी existing class में नई method जोड़ना।” यानी आप Laravel के core component जैसे <code>Str</code> या <code>Collection</code> को enhance कर सकते हैं custom methods से — वो भी globally पूरे app में।</p>
<p>उदाहरण के लिए, अगर आप बार-बार product name से slug बनाते हैं, तो उसके लिए आप एक macro method बना सकते हैं:</p>
<pre class="brush: php; title: ; notranslate">
// AppServiceProvider.php के boot() method में डालें
use Illuminate\Support\Str;

public function boot()
{
    Str::macro(&#039;productSlug&#039;, function ($name) {
        return Str::slug($name) . &#039;-&#039; . rand(1000, 9999);
    });
}
</pre>
<p>अब आप Laravel app में कहीं भी use कर सकते हैं:</p>
<pre class="brush: php; title: ; notranslate">
$slug = Str::productSlug(&#039;Silver Payal&#039;);
// Output: silver-payal-3842
</pre>
<h2>Collection में Macro कैसे जोड़ते हैं?</h2>
<p>Collection class में आप custom methods ऐसे add कर सकते हैं:</p>
<pre class="brush: php; title: ; notranslate">
use Illuminate\Support\Collection;

Collection::macro(&#039;toUpper&#039;, function () {
    return $this-&amp;gt;map(function ($value) {
        return strtoupper($value);
    });
});

// Usage:
collect(&#x5B;&#039;laravel&#039;, &#039;macro&#039;])-&amp;gt;toUpper();
// Output: &#x5B;&#039;LARAVEL&#039;, &#039;MACRO&#039;]
</pre>
<p>यह method automatically सभी collections में available हो जाएगी।</p>
<h2>Request Macro का Example</h2>
<p>कई बार आपको check करना होता है कि request <code>api/</code> path से आ रही है या नहीं। उसके लिए:</p>
<pre class="brush: php; title: ; notranslate">
use Illuminate\Http\Request;

Request::macro(&#039;isApiRequest&#039;, function () {
    return str_starts_with($this-&amp;gt;path(), &#039;api/&#039;);
});
</pre>
<p>अब आप किसी भी controller या middleware में लिख सकते हैं:</p>
<pre class="brush: php; title: ; notranslate">
if (request()-&amp;gt;isApiRequest()) {
    // Do something for API
}
</pre>
<h2>Macro के फायदे (Why Use Macros?)</h2>
<ul>
<li><strong>Reusability:</strong> बार-बार लिखने वाली logic को centralize करो</li>
<li><strong>Clean Code:</strong> helper functions से ज़्यादा readable और structured</li>
<li><strong>Extend Laravel Core:</strong> Laravel की inbuilt classes को customize करो बिना hack किए</li>
</ul>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-macro-methods/">Laravel Macro Methods</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-macro-methods/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 12: Step-by-Step Guide to Comment System with Replies</title>
		<link>https://codeplaners.com/laravel-12-step-by-step-guide-to-comment-system-with-replies/</link>
					<comments>https://codeplaners.com/laravel-12-step-by-step-guide-to-comment-system-with-replies/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 07 Jul 2025 05:24:41 +0000</pubDate>
				<category><![CDATA[Codeplaners]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 12]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1791</guid>

					<description><![CDATA[<p>Hi Dev, People can chat with you and each other. That makes them feel part of something, and they’re more likely to return. When readers comment, they spend more time on your page. They may even come back to reply. That’s good for your blog’s stickiness. Comments tell you what readers liked, didn’t get, or &#8230; <a href="https://codeplaners.com/laravel-12-step-by-step-guide-to-comment-system-with-replies/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 12: Step-by-Step Guide to Comment System with Replies"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-12-step-by-step-guide-to-comment-system-with-replies/">Laravel 12: Step-by-Step Guide to Comment System with Replies</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p> People can chat with you and each other. That makes them feel part of something, and they’re more likely to return. When readers comment, they spend more time on your page. They may even come back to reply. That’s good for your blog’s stickiness. Comments tell you what readers liked, didn’t get, or want more of—great sparks for new posts. Readers’ comments add new words and ideas to your posts. This can help search engines see your page as more valuable.</p>
<p>We’ll begin by adding Laravel UI to set up basic user authentication, including registration and login screens. Next, we’ll build a posts table with title and body fields to allow users to create content. Once users are registered, they&#8217;ll be able to publish posts that other users can view. We’ll enable commenting on posts, and also support replies to those comments for nested discussions. To manage these relationships, we&#8217;ll utilize Laravel’s Eloquent methods—hasMany() for one-to-many and belongsTo() for the inverse connection. Follow along through each step to implement this fully functional, user-driven content system with nested commenting!</p>
<p><strong>Step for Creating Comment System in Laravel 12</strong><br />
<strong>Step 1: </strong>Install Laravel 12<br />
<strong>Step 2:</strong> Create Auth using Scaffold<br />
<strong>Step 3:</strong> Create Posts and Comments Tables<br />
<strong>Step 4:</strong> Create Models<br />
<strong>Step 5:</strong> Create Routes<br />
<strong>Step 6:</strong> Create Controller<br />
<strong>Step 7:</strong> Create and Update Blade Files<br />
Run Laravel App</p>
<h3 class="step_code">Install Laravel 12</h3>
<p>For Installing Laravel application 12 run below command. let&#8217;s start:</p>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-app
</pre>
<h3 class="step_code"> Create Auth using Scaffold</h3>
<p>Now, we will create an auth scaffold command to generate login, register, and dashboard functionalities. So, run the below commands:</p>
<p><strong>Laravel 12 UI Package:</strong></p>
<pre class="brush: php; title: ; notranslate">
composer require laravel/ui 
</pre>
<p><strong>Generate Auth:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan ui bootstrap --auth 
</pre>
<pre class="brush: php; title: ; notranslate">
npm install
</pre>
<pre class="brush: php; title: ; notranslate">
npm run build
</pre>
<h3 class="step_code"> Create Posts and Comments Tables</h3>
<p>For Creating Posts and Comments tables run below command.</p>
<pre class="brush: php; title: ; notranslate">
php artisan make:migration create_posts_comments_table
</pre>
<p>now, let&#8217;s update the following migrations table:<br />
<strong>database/migrations/2024_06_19_140622_create_posts_comments_table.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create(&#039;posts&#039;, function (Blueprint $table) {
            $table-&gt;id();
            $table-&gt;string(&#039;title&#039;);
            $table-&gt;text(&#039;body&#039;);
            $table-&gt;timestamps();
        });

        Schema::create(&#039;comments&#039;, function (Blueprint $table) {
            $table-&gt;id();
            $table-&gt;integer(&#039;user_id&#039;)-&gt;unsigned();
            $table-&gt;integer(&#039;post_id&#039;)-&gt;unsigned();
            $table-&gt;integer(&#039;parent_id&#039;)-&gt;unsigned()-&gt;nullable();
            $table-&gt;text(&#039;body&#039;);
            $table-&gt;timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists(&#039;posts&#039;);
        Schema::dropIfExists(&#039;comments&#039;);
    }
};
</pre>
<p>now, run the following command:</p>
<pre class="brush: php; title: ; notranslate">
php artisan migrate
</pre>
<h3 class="step_code">Create Models</h3>
<p>To implement a comment system in Laravel, you&#8217;ll need to create Post and Comment models, update the User model, also we will right relationship and some model function.</p>
<pre class="brush: php; title: ; notranslate">
php artisan make:model Post
</pre>
<p>Now, With hasMany() relationship we will update the model file.</p>
<p><strong>app/Models/Post.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = &#x5B;&#039;title&#039;, &#039;body&#039;];
   
    /**
     * The has Many Relationship
     *
     * @var array
     */
    public function comments()
    {
        return $this-&gt;hasMany(Comment::class)-&gt;whereNull(&#039;parent_id&#039;)-&gt;latest();
    }
}
</pre>
<p><strong>app/Models/Comment.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = &#x5B;&#039;user_id&#039;, &#039;post_id&#039;, &#039;parent_id&#039;, &#039;body&#039;];
   
    /**
     * The belongs to Relationship
     *
     * @var array
     */
    public function user()
    {
        return $this-&gt;belongsTo(User::class);
    }
   
    /**
     * The has Many Relationship
     *
     * @var array
     */
    public function replies()
    {
        return $this-&gt;hasMany(Comment::class, &#039;parent_id&#039;);
    }
}
</pre>
<h3 class="step_code"> Create Routes</h3>
<p>Now, we need to create some routes. So open your &#8220;routes/web.php&#8221; file and add the following route.<br />
<strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\PostController;

Route::get(&#039;/&#039;, function () {
    return view(&#039;welcome&#039;);
});

Auth::routes();

Route::get(&#039;/home&#039;, &#x5B;App\Http\Controllers\HomeController::class, &#039;index&#039;])-&gt;name(&#039;home&#039;);

Route::middleware(&#039;auth&#039;)-&gt;group(function () {
    Route::get(&#039;/posts&#039;, &#x5B;PostController::class, &#039;index&#039;])-&gt;name(&#039;posts.index&#039;);
    Route::post(&#039;/posts&#039;, &#x5B;PostController::class, &#039;store&#039;])-&gt;name(&#039;posts.store&#039;);
    Route::get(&#039;/posts/{id}&#039;, &#x5B;PostController::class, &#039;show&#039;])-&gt;name(&#039;posts.show&#039;);
    Route::post(&#039;/posts/comment/store&#039;, &#x5B;PostController::class, &#039;commentStore&#039;])-&gt;name(&#039;posts.comment.store&#039;);
});
</pre>
<h3 class="step_code">Create Controller</h3>
<p>In this step, We create a new controoler, PostController. So let&#8217;s put the code below.<br />
<strong>app/Http/Controllers/PostController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
   
namespace App\Http\Controllers;
   
use Illuminate\Http\Request;
use App\Models\Post;
use App\Models\Comment;
   
class PostController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $posts = Post::latest()-&gt;get();
    
        return view(&#039;posts.index&#039;, compact(&#039;posts&#039;));
    }
    
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function store(Request $request)
    {
        $this-&gt;validate($request, &#x5B;
             &#039;title&#039; =&gt; &#039;required&#039;,
             &#039;body&#039; =&gt; &#039;required&#039;
        ]);
   
        $post = Post::create(&#x5B;
            &#039;title&#039; =&gt; $request-&gt;title,
            &#039;body&#039; =&gt; $request-&gt;body
        ]);
   
        return back()-&gt;with(&#039;success&#039;,&#039;Post created successfully.&#039;);
    }
    
    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $post = Post::find($id);
        return view(&#039;posts.show&#039;, compact(&#039;post&#039;));
    }

    /**
     * Write code on Method
     *
     * @return response()
     */
    public function commentStore(Request $request)
    {
        $request-&gt;validate(&#x5B;
            &#039;body&#039;=&gt;&#039;required&#039;,
        ]);
   
        $input = $request-&gt;all();
        $input&#x5B;&#039;user_id&#039;] = auth()-&gt;user()-&gt;id;
    
        Comment::create($input);
   
        return back()-&gt;with(&#039;success&#039;,&#039;Comment added successfully.&#039;);
    }
}
</pre>
<h3 class="step_code"> Create and Update Blade Files</h3>
<p>Now, we will update app.blade.php file and create posts.blade file. so, let&#8217;s do it.</p>
<p><strong>resources/views/layouts/app.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!doctype html&gt;
&lt;html lang=&quot;{{ str_replace(&#039;_&#039;, &#039;-&#039;, app()-&gt;getLocale()) }}&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;utf-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;

    &lt;!-- CSRF Token --&gt;
    &lt;meta name=&quot;csrf-token&quot; content=&quot;{{ csrf_token() }}&quot;&gt;

    &lt;title&gt;{{ config(&#039;app.name&#039;, &#039;Laravel&#039;) }}&lt;/title&gt;

    &lt;!-- Fonts --&gt;
    &lt;link rel=&quot;dns-prefetch&quot; href=&quot;//fonts.bunny.net&quot;&gt;
    &lt;link href=&quot;https://fonts.bunny.net/css?family=Nunito&quot; rel=&quot;stylesheet&quot;&gt;

    &lt;!-- Scripts --&gt;
    @vite(&#x5B;&#039;resources/sass/app.scss&#039;, &#039;resources/js/app.js&#039;])

    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css&quot; /&gt;

    &lt;style type=&quot;text/css&quot;&gt;
        .img-user{
            width: 40px;
            border-radius: 50%;
        }
        .col-md-1{
            padding-right: 0px !important;
        }
        .img-col{
            width: 5.33% !important;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id=&quot;app&quot;&gt;
        &lt;nav class=&quot;navbar navbar-expand-md navbar-light bg-white shadow-sm&quot;&gt;
            &lt;div class=&quot;container&quot;&gt;
                &lt;a class=&quot;navbar-brand&quot; href=&quot;{{ url(&#039;/&#039;) }}&quot;&gt;
                    Laravel Comment System Example - ItSolutionStuff.com
                &lt;/a&gt;
                &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#navbarSupportedContent&quot; aria-controls=&quot;navbarSupportedContent&quot; aria-expanded=&quot;false&quot; aria-label=&quot;{{ __(&#039;Toggle navigation&#039;) }}&quot;&gt;
                    &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
                &lt;/button&gt;

                &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarSupportedContent&quot;&gt;
                    &lt;!-- Left Side Of Navbar --&gt;
                    &lt;ul class=&quot;navbar-nav me-auto&quot;&gt;

                    &lt;/ul&gt;

                    &lt;!-- Right Side Of Navbar --&gt;
                    &lt;ul class=&quot;navbar-nav ms-auto&quot;&gt;
                        &lt;!-- Authentication Links --&gt;
                        @guest
                            @if (Route::has(&#039;login&#039;))
                                &lt;li class=&quot;nav-item&quot;&gt;
                                    &lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&#039;login&#039;) }}&quot;&gt;{{ __(&#039;Login&#039;) }}&lt;/a&gt;
                                &lt;/li&gt;
                            @endif

                            @if (Route::has(&#039;register&#039;))
                                &lt;li class=&quot;nav-item&quot;&gt;
                                    &lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&#039;register&#039;) }}&quot;&gt;{{ __(&#039;Register&#039;) }}&lt;/a&gt;
                                &lt;/li&gt;
                            @endif
                        @else
                            &lt;li class=&quot;nav-item&quot;&gt;
                                &lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&#039;posts.index&#039;) }}&quot;&gt;{{ __(&#039;Posts&#039;) }}&lt;/a&gt;
                            &lt;/li&gt;
                            &lt;li class=&quot;nav-item dropdown&quot;&gt;
                                &lt;a id=&quot;navbarDropdown&quot; class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; role=&quot;button&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot; v-pre&gt;
                                    {{ Auth::user()-&gt;name }}
                                &lt;/a&gt;

                                &lt;div class=&quot;dropdown-menu dropdown-menu-end&quot; aria-labelledby=&quot;navbarDropdown&quot;&gt;
                                    &lt;a class=&quot;dropdown-item&quot; href=&quot;{{ route(&#039;logout&#039;) }}&quot;
                                       onclick=&quot;event.preventDefault();
                                                     document.getElementById(&#039;logout-form&#039;).submit();&quot;&gt;
                                        {{ __(&#039;Logout&#039;) }}
                                    &lt;/a&gt;

                                    &lt;form id=&quot;logout-form&quot; action=&quot;{{ route(&#039;logout&#039;) }}&quot; method=&quot;POST&quot; class=&quot;d-none&quot;&gt;
                                        @csrf
                                    &lt;/form&gt;
                                &lt;/div&gt;
                            &lt;/li&gt;
                        @endguest
                    &lt;/ul&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/nav&gt;

        &lt;main class=&quot;py-4&quot;&gt;
            @yield(&#039;content&#039;)
        &lt;/main&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>resources/views/posts/index.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
@extends(&#039;layouts.app&#039;)

@section(&#039;content&#039;)
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row justify-content-center&quot;&gt;
        &lt;div class=&quot;col-md-12&quot;&gt;
            &lt;div class=&quot;card&quot;&gt;
                &lt;div class=&quot;card-header&quot;&gt;&lt;i class=&quot;fa fa-list&quot;&gt;&lt;/i&gt; {{ __(&#039;Posts List&#039;) }}&lt;/div&gt;

                &lt;div class=&quot;card-body&quot;&gt;

                    @session(&#039;success&#039;)
                        &lt;div class=&quot;alert alert-success&quot; role=&quot;alert&quot;&gt; 
                            {{ $value }}
                        &lt;/div&gt;
                    @endsession
                    
                    &lt;p&gt;&lt;strong&gt;Create New Post&lt;/strong&gt;&lt;/p&gt;
                    &lt;form method=&quot;post&quot; action=&quot;{{ route(&#039;posts.store&#039;) }}&quot; enctype=&quot;multipart/form-data&quot;&gt;
                        @csrf
                        &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label&gt;Title:&lt;/label&gt;
                            &lt;input type=&quot;text&quot; name=&quot;title&quot; class=&quot;form-control&quot; /&gt;
                            @error(&#039;title&#039;)
                                &lt;div class=&quot;text-danger&quot;&gt;{{ $message }}&lt;/div&gt;
                            @enderror
                        &lt;/div&gt;
                        &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label&gt;Body:&lt;/label&gt;
                            &lt;textarea class=&quot;form-control&quot; name=&quot;body&quot;&gt;&lt;/textarea&gt;
                            @error(&#039;body&#039;)
                                &lt;div class=&quot;text-danger&quot;&gt;{{ $message }}&lt;/div&gt;
                            @enderror
                        &lt;/div&gt;
                        &lt;div class=&quot;form-group mt-2&quot;&gt;
                            &lt;button type=&quot;submit&quot; class=&quot;btn btn-success btn-block&quot;&gt;&lt;i class=&quot;fa fa-save&quot;&gt;&lt;/i&gt; Submit&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/form&gt;

                    &lt;p class=&quot;mt-4&quot;&gt;&lt;strong&gt;Post List:&lt;/strong&gt;&lt;/p&gt;
                    
                    @foreach($posts as $post)
                        &lt;div class=&quot;card mt-2&quot;&gt;
                          &lt;div class=&quot;card-body&quot;&gt;
                            &lt;h5 class=&quot;card-title&quot;&gt;{{ $post-&gt;title }}&lt;/h5&gt;
                            &lt;p class=&quot;card-text&quot;&gt;{{ $post-&gt;body }}&lt;/p&gt;
                            &lt;div class=&quot;text-end&quot;&gt;
                                &lt;a href=&quot;{{ route(&#039;posts.show&#039;, $post-&gt;id) }}&quot; class=&quot;btn btn-primary&quot;&gt;View&lt;/a&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
                    @endforeach

                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
@endsection
</pre>
<p><strong>resources/views/posts/show.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
@extends(&#039;layouts.app&#039;)

@section(&#039;content&#039;)
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row justify-content-center&quot;&gt;
        &lt;div class=&quot;col-md-12&quot;&gt;
            &lt;div class=&quot;card&quot;&gt;
                &lt;div class=&quot;card-header&quot;&gt;&lt;h1&gt;&lt;i class=&quot;fa fa-thumbs-up&quot;&gt;&lt;/i&gt; {{ $post-&gt;title }}&lt;/h1&gt;&lt;/div&gt;

                &lt;div class=&quot;card-body&quot;&gt;

                    @session(&#039;success&#039;)
                        &lt;div class=&quot;alert alert-success&quot; role=&quot;alert&quot;&gt; 
                            {{ $value }}
                        &lt;/div&gt;
                    @endsession

                    {{ $post-&gt;body }}

                    &lt;h4 class=&quot;mt-4&quot;&gt;Comments:&lt;/h4&gt;

                    &lt;form method=&quot;post&quot; action=&quot;{{ route(&#039;posts.comment.store&#039;) }}&quot;&gt;
                        @csrf
                        &lt;div class=&quot;form-group&quot;&gt;
                            &lt;textarea class=&quot;form-control&quot; name=&quot;body&quot; placeholder=&quot;Write Your Comment...&quot;&gt;&lt;/textarea&gt;
                            &lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; value=&quot;{{ $post-&gt;id }}&quot; /&gt;
                        &lt;/div&gt;
                        &lt;div class=&quot;form-group text-end&quot;&gt;
                            &lt;button class=&quot;btn btn-success mt-2&quot;&gt;&lt;i class=&quot;fa fa-comment&quot;&gt;&lt;/i&gt; Add Comment&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/form&gt;
                    
                    &lt;hr/&gt;
                    @include(&#039;posts.comments&#039;, &#x5B;&#039;comments&#039; =&gt; $post-&gt;comments, &#039;post_id&#039; =&gt; $post-&gt;id])
                    
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
@endsection

</pre>
<p><strong>resources/views/posts/comments.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
@foreach($comments as $comment)
    &lt;div class=&quot;display-comment row mt-3&quot; @if($comment-&gt;parent_id != null) style=&quot;margin-left:40px;&quot; @endif&gt;
        &lt;div class=&quot;col-md-1 text-end img-col&quot;&gt;
            &lt;img src=&quot;https://randomuser.me/api/portraits/men/43.jpg&quot; class=&quot;img-user&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;col-md-11&quot;&gt;
            &lt;strong&gt;{{ $comment-&gt;user-&gt;name }}&lt;/strong&gt;
            &lt;br/&gt;&lt;small&gt;&lt;i class=&quot;fa fa-clock&quot;&gt;&lt;/i&gt; {{ $comment-&gt;created_at-&gt;diffForHumans() }}&lt;/small&gt;
            &lt;p&gt;{!! nl2br($comment-&gt;body) !!}&lt;/p&gt;
            &lt;form method=&quot;post&quot; action=&quot;{{ route(&#039;posts.comment.store&#039;) }}&quot;&gt;
                @csrf
                &lt;div class=&quot;row&quot;&gt;
                    &lt;div class=&quot;col-md-11&quot;&gt;
                        &lt;div class=&quot;form-group&quot;&gt;
                            &lt;textarea class=&quot;form-control&quot; name=&quot;body&quot; placeholder=&quot;Write Your Reply...&quot; style=&quot;height: 40px;&quot;&gt;&lt;/textarea&gt;
                            &lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; value=&quot;{{ $post_id }}&quot; /&gt;
                            &lt;input type=&quot;hidden&quot; name=&quot;parent_id&quot; value=&quot;{{ $comment-&gt;id }}&quot; /&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;col-md-1&quot;&gt;
                        &lt;button class=&quot;btn btn-warning&quot;&gt;&lt;i class=&quot;fa fa-reply&quot;&gt;&lt;/i&gt; Reply&lt;/button&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/form&gt;
            @include(&#039;posts.comments&#039;, &#x5B;&#039;comments&#039; =&gt; $comment-&gt;replies])
        &lt;/div&gt;
    &lt;/div&gt;
@endforeach
</pre>
<p><strong>Run Laravel App:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-12-step-by-step-guide-to-comment-system-with-replies/">Laravel 12: Step-by-Step Guide to Comment System with Replies</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-12-step-by-step-guide-to-comment-system-with-replies/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mojo Syntax Guide in Hindi – Variables, Constants, Types Explained</title>
		<link>https://codeplaners.com/mojo-syntax-variables-constants-hindi/</link>
					<comments>https://codeplaners.com/mojo-syntax-variables-constants-hindi/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 28 Jun 2025 17:33:53 +0000</pubDate>
				<category><![CDATA[Mojo]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1788</guid>

					<description><![CDATA[<p>इस ब्लॉग में आप सीखेंगे: Mojo में Variables और Constants कैसे बनाएँ Data types कौन-कौन से होते हैं Syntax और Examples Variable Declaration Mojo में var keyword से variable define करते हैं। var age: Int = 25 var name: String = &#34;Rahul&#34; var isActive: Bool = True Constants with let जो value change नहीं होगी, &#8230; <a href="https://codeplaners.com/mojo-syntax-variables-constants-hindi/" class="more-link">Continue reading<span class="screen-reader-text"> "Mojo Syntax Guide in Hindi – Variables, Constants, Types Explained"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/mojo-syntax-variables-constants-hindi/">Mojo Syntax Guide in Hindi – Variables, Constants, Types Explained</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>इस ब्लॉग में आप सीखेंगे:</h3>
<ul>
<li>Mojo में Variables और Constants कैसे बनाएँ</li>
<li>Data types कौन-कौन से होते हैं</li>
<li>Syntax और Examples</li>
</ul>
<h3>Variable Declaration</h3>
<p>Mojo में <code>var</code> keyword से variable define करते हैं।</p>
<pre class="brush: xml; title: ; notranslate">var age: Int = 25
var name: String = &quot;Rahul&quot;
var isActive: Bool = True
</pre>
<h3>Constants with let</h3>
<p>जो value change नहीं होगी, उसके लिए <code>let</code> keyword use करें।</p>
<pre class="brush: xml; title: ; notranslate">let PI: Float = 3.1415
let country: String = &quot;India&quot;
</pre>
<h3>Mojo Types</h3>
<ul>
<li><code>Int</code>: पूरा number</li>
<li><code>Float</code>: दशमलव number</li>
<li><code>Bool</code>: True/False</li>
<li><code>String</code>: Text</li>
</ul>
<pre class="brush: xml; title: ; notranslate">var count: Int = 10
var price: Float = 99.99
var isAvailable: Bool = False
var message: String = &quot;Hello Mojo&quot;
</pre>
<h3>Type Annotations जरूरी हैं</h3>
<p>Mojo में type देना जरूरी है:</p>
<pre class="brush: xml; title: ; notranslate">var x: Int = 10   सही
var x = 10       गलत
</pre>
<h3>Sample Mojo Program</h3>
<pre class="brush: xml; title: ; notranslate">fn main():
    var age: Int = 20
    let country: String = &quot;India&quot;
    var price: Float = 99.5
    var isMember: Bool = True

    print(&quot;Age:&quot;, age)
    print(&quot;Country:&quot;, country)
    print(&quot;Price:&quot;, price)
    print(&quot;Is Member:&quot;, isMember)
</pre>
<p><strong>Output:</strong></p>
<pre class="brush: xml; title: ; notranslate">Age: 20
Country: India
Price: 99.5
Is Member: True
</pre>
<h3>Tips:</h3>
<ul>
<li><code>var</code>: changeable values</li>
<li><code>let</code>: constant values</li>
<li>Indentation Python जैसा</li>
</ul>
<h3>अगले ब्लॉग में:</h3>
<p>Blog 4: Mojo Functions – Define, Parameters, Return Types</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/mojo-syntax-variables-constants-hindi/">Mojo Syntax Guide in Hindi – Variables, Constants, Types Explained</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/mojo-syntax-variables-constants-hindi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Mojo Language 2025</title>
		<link>https://codeplaners.com/how-to-install-mojo-language-2025/</link>
					<comments>https://codeplaners.com/how-to-install-mojo-language-2025/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 26 Jun 2025 16:25:41 +0000</pubDate>
				<category><![CDATA[Mojo]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1784</guid>

					<description><![CDATA[<p>Mojo को चलाने के दो तरीके Mojo language फिलहाल दो main तरीकों से चल सकती है: Modular Playground (Online) – No Installation अगर आप जल्दी से Mojo का प्रयोग करना चाहते हैं, तो Modular का online Playground सबसे आसान तरीका है। Playground लिंक: https://www.modular.com/play कोई installation नहीं सीधे browser में code likhiye aur run kijiye &#8230; <a href="https://codeplaners.com/how-to-install-mojo-language-2025/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Install Mojo Language 2025"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-mojo-language-2025/">How to Install Mojo Language 2025</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Mojo को चलाने के दो तरीके</h3>
<p>Mojo language फिलहाल दो main तरीकों से चल सकती है:</p>
<h4>Modular Playground (Online) – No Installation</h4>
<p>अगर आप जल्दी से Mojo का प्रयोग करना चाहते हैं, तो <strong>Modular का online Playground</strong> सबसे आसान तरीका है।</p>
<p>Playground लिंक: <a href="https://www.modular.com/play" target="_blank" rel="noopener">https://www.modular.com/play</a></p>
<ul>
<li>कोई installation नहीं</li>
<li>सीधे browser में code likhiye aur run kijiye</li>
<li>Python interoperability bhi try kar सकते हैं</li>
</ul>
<h4>Mojo SDK via CLI (Linux/Mac Only)</h4>
<blockquote><p> Windows users के लिए CLI फिलहाल उपलब्ध नहीं है (WSL या VM से workaround किया जा सकता है)।</p></blockquote>
<h5>Installation Steps (Linux/Mac):</h5>
<h6>Step 1: Modular SDK के लिए signup</h6>
<ul>
<li>Visit: <a href="https://www.modular.com/mojo" target="_blank" rel="noopener">https://www.modular.com/mojo</a></li>
<li>Account create करके CLI key प्राप्त करें</li>
</ul>
<h6>Step 2: Modular CLI install करें</h6>
<pre class="brush: xml; title: ; notranslate">curl -L https://get.modular.com | bash</pre>
<h6>Step 3: Modular login करें</h6>
<pre class="brush: xml; title: ; notranslate">modular login</pre>
<h6>Step 4: Mojo toolchain install करें</h6>
<pre class="brush: xml; title: ; notranslate">modular install mojo</pre>
<h6>Step 5: Pehla Mojo file create करें</h6>
<pre class="brush: xml; title: ; notranslate">touch hello.mojo</pre>
<h6>Step 6: Hello World code likhiye</h6>
<pre class="brush: xml; title: ; notranslate">fn main():
    print(&quot;Hello, Mojo!&quot;)</pre>
<h6>Step 7: Program run करें</h6>
<pre class="brush: xml; title: ; notranslate">mojo hello.mojo</pre>
<hr />
<h3> Output:</h3>
<pre class="brush: xml; title: ; notranslate">Hello, Mojo!</pre>
<p>Agar yeh print hota hai, to aapka Mojo setup sahi hai <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f389.png" alt="🎉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<hr />
<h3>Tips:</h3>
<ul>
<li>Mojo file extension <code>.mojo</code> होता है</li>
<li><code>fn main():</code> ka मतलब है “program यहीं से शुरू होगा”</li>
<li>Python जैसी indentation-based syntax</li>
</ul>
<h3>Errors आएं तो क्या करें?</h3>
<ul>
<li>Check करें कि <code>modular</code> command install है या नहीं</li>
<li>Internet connection required है login के लिए</li>
<li>CLI version updated होनी चाहिए</li>
</ul>
<hr />
<h3>अगला ब्लॉग:</h3>
<p><strong>Blog 3: Mojo का Syntax – Variables, Constants और Types</strong></p>
<p>Series जारी रहेगी – रोजाना एक नया Mojo tutorial आपके लिए!</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-mojo-language-2025/">How to Install Mojo Language 2025</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-install-mojo-language-2025/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 12: Managing Routes Without RouteServiceProvider</title>
		<link>https://codeplaners.com/laravel-12-managing-routes-without-routeserviceprovider/</link>
					<comments>https://codeplaners.com/laravel-12-managing-routes-without-routeserviceprovider/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 26 Jun 2025 07:06:56 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 12]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1781</guid>

					<description><![CDATA[<p>Hi Dev, before, In laravel routes made in RouteServiceProvider.php file. but, Now laravel 12 give an option to configure about routes in app.php. So, now you will have a question that if we want to create a custom route file without RouteServicesProvider.php file. so what will our next step. But laravel 12 provides options in &#8230; <a href="https://codeplaners.com/laravel-12-managing-routes-without-routeserviceprovider/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 12: Managing Routes Without RouteServiceProvider"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-12-managing-routes-without-routeserviceprovider/">Laravel 12: Managing Routes Without RouteServiceProvider</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>before, In laravel routes made in RouteServiceProvider.php file. but, Now laravel 12 give an option to configure about routes in app.php.</p>
<p>So, now you will have a question that if we want to create a custom route file without RouteServicesProvider.php file. so what will our next step.<br />
But laravel 12 provides options in app.php file to define custom routes file options and you can customize routes from that file as well.</p>
<p>Before in laravel you created custom route file like below code:<br />
<strong>app/Providers/RouteServiceProvider.php</strong></p>
<pre class="brush: php; title: ; notranslate">
public function boot()
{
  $this-&gt;routes(function () {
    Route::middleware(&#039;web&#039;)
            -&gt;prefix(&#039;admin&#039;)
            -&gt;group(base_path(&#039;routes/admin.php&#039;));
  });
}
</pre>
<p>Now, In laravel 12 you can create custom route file like below code.<br />
<strong>bootstrap/app.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Support\Facades\Route;

return Application::configure(basePath: dirname(__DIR__))
    -&gt;withRouting(
        web: __DIR__.&#039;/../routes/web.php&#039;,
        commands: __DIR__.&#039;/../routes/console.php&#039;,
        channels: __DIR__.&#039;/../routes/channels.php&#039;,
        health: &#039;/up&#039;,
        then: function () {
            Route::middleware(&#039;web&#039;)
                -&gt;prefix(&#039;admin&#039;)
                -&gt;group(base_path(&#039;routes/admin.php&#039;));
        }
    )
    -&gt;withMiddleware(function (Middleware $middleware) {
        //
    })
    -&gt;withExceptions(function (Exceptions $exceptions) {
        //
    })-&gt;create();
</pre>
<p>&#8220;It&#8217;s time to build your own admin.php file, adhering to the following structure.&#8221;<br />
<strong>routes/admin.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Support\Facades\Route;

Route::get(&#039;/dashboard&#039;, &#x5B;App\Http\Controllers\HomeController::class, &#039;index&#039;]);
Route::get(&#039;/users&#039;, &#x5B;App\Http\Controllers\UserController::class, &#039;index&#039;]);
Route::get(&#039;/posts&#039;, &#x5B;App\Http\Controllers\PostController::class, &#039;index&#039;]);
</pre>
<p>For seeing the list of routes you can run below command:</p>
<pre class="brush: php; title: ; notranslate">
php artisan route:list
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-12-managing-routes-without-routeserviceprovider/">Laravel 12: Managing Routes Without RouteServiceProvider</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-12-managing-routes-without-routeserviceprovider/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mojo Programming Language क्या है? जानिए Python से कितनी तेज और बेहतर है</title>
		<link>https://codeplaners.com/mojo-programming-language-hindi/</link>
					<comments>https://codeplaners.com/mojo-programming-language-hindi/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 25 Jun 2025 02:47:40 +0000</pubDate>
				<category><![CDATA[Mojo]]></category>
		<category><![CDATA[AI programming language]]></category>
		<category><![CDATA[Mojo kya hai]]></category>
		<category><![CDATA[Mojo language]]></category>
		<category><![CDATA[Mojo vs Python]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1775</guid>

					<description><![CDATA[<p>Mojo Programming Language kya hai? Python se kitni alag hai – AI Developers ki nayi pasand Mojo ek naye zamane ki programming language hai, jise AI aur high-performance computing ke liye banaya gaya hai. Iska aim hai Python ki simplicity ko C/C++ ki speed ke saath combine karna. Is language ko banaya hai Chris Lattner &#8230; <a href="https://codeplaners.com/mojo-programming-language-hindi/" class="more-link">Continue reading<span class="screen-reader-text"> "Mojo Programming Language क्या है? जानिए Python से कितनी तेज और बेहतर है"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/mojo-programming-language-hindi/">Mojo Programming Language क्या है? जानिए Python से कितनी तेज और बेहतर है</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Mojo Programming Language kya hai? Python se kitni alag hai – AI Developers ki nayi pasand</h3>
<p><strong>Mojo ek naye zamane ki programming language hai</strong>, jise AI aur high-performance computing ke liye banaya gaya hai. Iska aim hai Python ki simplicity ko C/C++ ki speed ke saath combine karna. Is language ko banaya hai <strong>Chris Lattner</strong> ne – jo Swift language ke creator bhi hain.</p>
<h2>Mojo Programming Language ki khas baatein:</h2>
<ol style="list-style: circle;">
<li><strong>Python jaise syntax:</strong> Python developers isey bina naye syntax sikhe use kar sakte hain.</li>
<li><strong>C/C++ jaise performance:</strong> Mojo compiled language hai jo CPU-level optimization karta hai.</li>
<li><strong>AI/ML ke liye perfect:</strong> Mojo specifically AI workloads ke liye design ki gayi hai.</li>
<li><strong>Static + Dynamic typing:</strong> Aap chahe to Python jaise dynamic typing karein, ya safety ke liye static typing.</li>
<li><strong>Memory safety:</strong> Mojo compile-time pe memory errors pakad leta hai – segmentation fault ka khatra kam.</li>
<li><strong>Mojo Playground:</strong> Aap bina kuch install kiye web browser me Mojo code run kar sakte ho (Modular.com par).</li>
</ol>
<h2>Mojo vs Python – Kya fark hai?</h2>
<table style="width:100%">
<tbody>
<tr>
<th>Feature</th>
<th>Python</th>
<th>Mojo</th>
</tr>
<tr>
<td>Syntax</td>
<td>Simple</td>
<td>Python-jaisa</td>
</tr>
<tr>
<td>Performance</td>
<td>Slow (interpreted)</td>
<td>Fast (compiled)</td>
</tr>
<tr>
<td>Use Cases</td>
<td>Web, Scripting</td>
<td>AI/ML, HPC</td>
</tr>
<tr>
<td>Typing</td>
<td>Dynamic only</td>
<td>Dynamic + Static</td>
</tr>
<tr>
<td>Speed</td>
<td>Medium</td>
<td>Very Fast</td>
</tr>
<tr>
<td>Memory Safety</td>
<td>Nahin</td>
<td>Haan (compile-time)</td>
</tr>
</tbody>
</table>
<h2>Mojo kaise install karein?</h2>
<h3>Option 1: Mojo Playground</h3>
<ul data-spread="false">
<li>Modular ka official <a>Mojo Playground</a> par jaake aap bina kisi setup ke code likh sakte hain.</li>
</ul>
<h3>Option 2: Local Installation (CLI se)</h3>
<ul data-spread="false">
<li>Modular ke CLI tools se aap Mojo local machine me run kar sakte hain (Linux/macOS ke liye available).</li>
</ul>
<pre class="brush: xml; title: ; notranslate">
fn say_hello():
    print(&quot;Hello from Mojo!&quot;)

say_hello()</pre>
<h2>Mojo AI Developers ke liye kyun important hai?</h2>
<ul data-spread="false">
<li>Mojo low-level access deta hai bina Python ki simplicity khoe.</li>
<li>CUDA, MLIR, aur compiler optimizations Mojo ke core me hain.</li>
<li>Bahut se Python-based ML models Mojo me migrate ho sakte hain performance ke liye.</li>
</ul>
<h2>Kya Mojo future hai?</h2>
<ul data-spread="false">
<li>Mojo abhi early access me hai, lekin iska adoption tezi se badh raha hai.</li>
<li>AI startups aur research labs isey test kar rahe hain.</li>
<li>Agar aap Python developer hain to Mojo seekhna aapko edge de sakta hai.</li>
</ul>
<h2>Conclusion</h2>
<p>Mojo ek revolution ho sakta hai AI aur high-performance programming ke world me. Agar aap future-ready banna chahte hain, to aaj se hi Mojo ke basics sikhna start kijiye!</p>
<p><strong>Aur aise hi blogs ke liye padte rahiye: </strong><a href="https://codeplaners.com"><strong>CodePlaners.com</strong></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/mojo-programming-language-hindi/">Mojo Programming Language क्या है? जानिए Python से कितनी तेज और बेहतर है</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/mojo-programming-language-hindi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 11 vs Laravel 12: नया क्या है और क्या आपको अपग्रेड करना चाहिए?</title>
		<link>https://codeplaners.com/laravel-11-vs-laravel-12-difference-upgrade-guide-hindi/</link>
					<comments>https://codeplaners.com/laravel-11-vs-laravel-12-difference-upgrade-guide-hindi/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 24 Jun 2025 16:35:00 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 11]]></category>
		<category><![CDATA[Laravel 12]]></category>
		<category><![CDATA[Laravel 11 vs Laravel 12]]></category>
		<category><![CDATA[Laravel 12 नया क्या है]]></category>
		<category><![CDATA[Laravel comparison]]></category>
		<category><![CDATA[Laravel developer tips]]></category>
		<category><![CDATA[Laravel guide 2025]]></category>
		<category><![CDATA[Laravel Hindi blog]]></category>
		<category><![CDATA[Laravel latest version]]></category>
		<category><![CDATA[Laravel new features]]></category>
		<category><![CDATA[Laravel performance]]></category>
		<category><![CDATA[Laravel tutorial in Hindi]]></category>
		<category><![CDATA[Laravel update]]></category>
		<category><![CDATA[Laravel upgrade]]></category>
		<category><![CDATA[Laravel अपग्रेड गाइड]]></category>
		<category><![CDATA[PHP framework]]></category>
		<category><![CDATA[PHP फ्रेमवर्क हिंदी में]]></category>
		<category><![CDATA[लारवेल 11 बनाम 12]]></category>
		<category><![CDATA[लारवेल ट्यूटोरियल हिंदी]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1769</guid>

					<description><![CDATA[<p>Laravel 11 vs Laravel 12 – कौन बेहतर है? Laravel का हर नया वर्जन developers के लिए नए features, improvements और बेहतर performance लेकर आता है। Laravel 12 फरवरी 2025 में रिलीज़ हुआ है और इसमें कई ऐसे बदलाव किए गए हैं जो Laravel 11 से अलग हैं। आइए विस्तार से जानते हैं Laravel 11 &#8230; <a href="https://codeplaners.com/laravel-11-vs-laravel-12-difference-upgrade-guide-hindi/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 11 vs Laravel 12: नया क्या है और क्या आपको अपग्रेड करना चाहिए?"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-11-vs-laravel-12-difference-upgrade-guide-hindi/">Laravel 11 vs Laravel 12: नया क्या है और क्या आपको अपग्रेड करना चाहिए?</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Laravel 11 vs Laravel 12 – कौन बेहतर है?</h2>
<p>Laravel का हर नया वर्जन developers के लिए नए features, improvements और बेहतर performance लेकर आता है। Laravel 12 फरवरी 2025 में रिलीज़ हुआ है और इसमें कई ऐसे बदलाव किए गए हैं जो Laravel 11 से अलग हैं। आइए विस्तार से जानते हैं Laravel 11 और Laravel 12 के बीच क्या अंतर है।</p>
<h3> इस ब्लॉग में आप जानेंगे:</h3>
<ul>
<li>Laravel 11 और Laravel 12 की मुख्य विशेषताएँ</li>
<li>कौन-सा version किसके लिए बेहतर है?</li>
<li>Laravel 12 में क्या नया है?</li>
<li>Upgrade गाइड: Laravel 11 से 12 में कैसे जाएं?</li>
</ul>
<h2>Laravel 11 vs Laravel 12: मुख्य अंतर</h2>
<table>
<thead>
<tr>
<th>पैरामीटर</th>
<th>Laravel 11</th>
<th>Laravel 12</th>
</tr>
</thead>
<tbody>
<tr>
<td>रिलीज़ डेट</td>
<td>12 मार्च 2024</td>
<td>24 फरवरी 2025</td>
</tr>
<tr>
<td>PHP वर्जन सपोर्ट</td>
<td>8.2 &#8211; 8.4</td>
<td>8.2 &#8211; 8.4</td>
</tr>
<tr>
<td>Frontend Stacks</td>
<td>React, Vue (basic)</td>
<td>New React/Vue + Livewire kits</td>
</tr>
<tr>
<td>New Features</td>
<td>Slim skeleton, built-in scheduler</td>
<td>WorkOS AuthKit, Flux UI, GraphQL</td>
</tr>
<tr>
<td>Performance</td>
<td>Good</td>
<td>Improved with async queues</td>
</tr>
<tr>
<td>Security</td>
<td>Standard</td>
<td>Advanced MFA, Password Hashing</td>
</tr>
<tr>
<td>Upgrade Complexity</td>
<td>Low to Medium</td>
<td>Very Low</td>
</tr>
</tbody>
</table>
<h2>Laravel 12 की नई विशेषताएं</h2>
<ul>
<li><strong>Starter Kits</strong> – Inertia.js 2, TypeScript, Tailwind, Livewire Flux UI</li>
<li><strong>WorkOS AuthKit</strong> – Passkeys, Social Login, SSO</li>
<li><strong>GraphQL Support</strong> – API developers के लिए built-in सपोर्ट</li>
<li><strong>Stricter Typing</strong> – बेहतर code intelligence और कम bugs</li>
<li><strong>Performance Improvements</strong> – Faster routing, better queue handling</li>
<li><strong>Security Upgrades</strong> – Advanced CSRF, password hashing algorithms</li>
</ul>
<h2>Laravel 11 से Laravel 12 में Upgrade कैसे करें?</h2>
<ol>
<li>Composer में Laravel dependency को <code>^12.0</code> पर सेट करें</li>
<li>Carbon 3.x में upgrade करें (2.x सपोर्ट नहीं है)</li>
<li>PHPUnit और Pest के नए वर्जन इस्तेमाल करें</li>
<li>Laravel Installer और Herd CLI को update करें</li>
</ol>
<p> अपग्रेड में 5 मिनट से भी कम लगते हैं अगर आप Laravel 11 पहले से इस्तेमाल कर रहे हैं।</p>
<h2>Conclusion</h2>
<p>अगर आप stability और modern tools चाहते हैं तो Laravel 12 एक बेहतरीन अपग्रेड है। यह secure, तेज़ और future-ready है। Laravel 11 भी अच्छा है, लेकिन 12 में आपको better developer experience और नए stacks का सपोर्ट मिलता है।</p>
<p><strong>क्या आपने Laravel 12 को आज़माया है? नीचे कमेंट में ज़रूर बताएं।</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-11-vs-laravel-12-difference-upgrade-guide-hindi/">Laravel 11 vs Laravel 12: नया क्या है और क्या आपको अपग्रेड करना चाहिए?</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-11-vs-laravel-12-difference-upgrade-guide-hindi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to send Real-Time Notifications using Pusher Example in Laravel 12</title>
		<link>https://codeplaners.com/how-to-send-real-time-notifications-using-pusher-example-in-laravel-12/</link>
					<comments>https://codeplaners.com/how-to-send-real-time-notifications-using-pusher-example-in-laravel-12/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 24 Jun 2025 12:00:07 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 12]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1763</guid>

					<description><![CDATA[<p>Hi Dev, In this article, I will show you how to send real-time notification with Pusher in the laravel 12. we will use a pusher driver to send real-time notification using the echo server in the laravel 12 What is Pusher? Pusher: Pusher lets apps talk to each other in real time — like live &#8230; <a href="https://codeplaners.com/how-to-send-real-time-notifications-using-pusher-example-in-laravel-12/" class="more-link">Continue reading<span class="screen-reader-text"> "How to send Real-Time Notifications using Pusher Example in Laravel 12"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-send-real-time-notifications-using-pusher-example-in-laravel-12/">How to send Real-Time Notifications using Pusher Example in Laravel 12</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>In this article, I will show you how to send real-time notification with Pusher in the laravel 12. we will use a pusher driver to send real-time notification using the echo server in the laravel 12</p>
<p><strong> What is Pusher?</strong><br />
<strong>Pusher: </strong><br />
Pusher lets apps talk to each other in real time — like live chat or instant updates on your screen.</p>
<p>It uses WebSockets (a fast, always-on connection) so information flows instantly, not by checking every few seconds.</p>
<p>Think of it as a messenger service: your server sends a message using Pusher, and all connected users get it right away.</p>
<p><strong>Here’s what we’ll build in this example:</strong></p>
<p>1. Create authentication scaffolding using Laravel UI to get login/register dashboards up and running.<br />
2. Set up two user roles: a super admin and a normal user, distinguished via an is_admin flag.<br />
3. Define a posts table with title and body columns, and create corresponding Eloquent models.<br />
4. Enable users to create posts through a form, saving them via a controller.<br />
5. Fire a broadcast event (PostCreated) when a post is saved—this triggers a real-time notification via Pusher to admins.</p>
<p><strong>Step 1:</strong> Install Laravel 12<br />
<strong>Step 2:</strong> Create Auth using Scaffold<br />
<strong>Step 3:</strong> Create Migrations<br />
<strong>Step 4:</strong> Create and Update Models<br />
<strong>Step 5:</strong> Create Pusher App<br />
<strong>Step 6:</strong> Setup Pusher &#038; Echo Server<br />
<strong>Step 7:</strong> Create PostCreate Event<br />
<strong>Step 8:</strong> Create Routes<br />
<strong>Step 9:</strong> create Controller<br />
<strong>Step 10:</strong> create Blade Files<br />
<strong>Step 11:</strong> Create admin User </p>
<h3 class="step_code">Install Laravel 12</h3>
<p>For Installing Laravel application 12 run below command. let&#8217;s start:</p>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-app
</pre>
<h3 class="step_code"> Create Auth using Scaffold</h3>
<p>Now, we will create an auth scaffold command to generate login, register, and dashboard functionalities. So, run the below commands:</p>
<p><strong>Laravel 12 UI Package:</strong></p>
<pre class="brush: php; title: ; notranslate">
composer require laravel/ui 
</pre>
<p><strong>Generate Auth:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan ui bootstrap --auth 
</pre>
<pre class="brush: php; title: ; notranslate">
npm install
</pre>
<pre class="brush: php; title: ; notranslate">
npm run build
</pre>
<h3 class="step_code">Create Migrations</h3>
<p>Here, we will create posts and add is_admin column to users table. So, run the below commands: </p>
<pre class="brush: php; title: ; notranslate">
php artisan make:migration add_is_admin_column_table
</pre>
<pre class="brush: php; title: ; notranslate">
php artisan make:migration create_posts_table
</pre>
<p><strong>database/migrations/2025_06_23_100454_create_posts_table.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table(&#039;users&#039;, function (Blueprint $table) {
            $table-&gt;tinyInteger(&#039;is_admin&#039;)-&gt;default(0);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        //
    }
};
</pre>
<p><strong>database/migrations/2025_06_23_100442_add_is_admin_column_table.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create(&#039;posts&#039;, function (Blueprint $table) {
            $table-&gt;id();
            $table-&gt;foreignId(&#039;user_id&#039;)-&gt;constrained()-&gt;onDelete(&#039;cascade&#039;);
            $table-&gt;string(&#039;title&#039;);
            $table-&gt;text(&#039;body&#039;);
            $table-&gt;timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists(&#039;posts&#039;);
    }
};
</pre>
<p>now, Let&#8217;s run the below command:</p>
<pre class="brush: php; title: ; notranslate">
php artisan migrate
</pre>
<h3 class="step_code"> Create and Update Models</h3>
<p>Now, we will create model using below command. we also need to update User model here. we will write relationship and some model function for like and dislike.</p>
<pre class="brush: php; title: ; notranslate">
php artisan make:model Post
</pre>
<p><strong>app/Models/Post.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    use HasFactory;

    protected $fillable = &#x5B;&#039;title&#039;, &#039;body&#039;, &#039;user_id&#039;];

    /**
     * Write code on Method
     *
     * @return response()
     */
    public function user()
    {
        return $this-&gt;belongsTo(User::class);
    }
}
</pre>
<p><strong>app/Models/User.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use HasFactory, Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = &#x5B;
        &#039;name&#039;,
        &#039;email&#039;,
        &#039;password&#039;,
        &#039;is_admin&#039;
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array
     */
    protected $hidden = &#x5B;
        &#039;password&#039;,
        &#039;remember_token&#039;,
    ];

    /**
     * Get the attributes that should be cast.
     *
     * @return array
     */
    protected function casts(): array
    {
        return &#x5B;
            &#039;email_verified_at&#039; =&gt; &#039;datetime&#039;,
            &#039;password&#039; =&gt; &#039;hashed&#039;,
        ];
    }
}
</pre>
<h3 class="step_code">Create Pusher App</h3>
<p>In this step, we will create account on pusher website. Here, you&#8217;ll find the following credentials: App ID, Key, Secret, Cluster.<br />
1. Create Account on Pusher Platform.<br />
2. Now, Click on Get Started button.</p>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2025/06/screen-1.jpg" alt="" style="width: 80%;border: 2px solid #e5e7eb;border-radius: 0.75rem;box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);object-fit: cover;" /></p>
<p>3. Fill your app name than click on submit button.</p>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2025/06/screen-2.jpg" alt="" style="width: 80%;border: 2px solid #e5e7eb;border-radius: 0.75rem;box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);object-fit: cover;" /></p>
<p>4. Now, go to App Keys section and copy details. we will use it latter:</p>
<p><img decoding="async" src="https://codeplaners.com/wp-content/uploads/2025/06/screen-3.jpg" alt="" style="width: 80%;border: 2px solid #e5e7eb;border-radius: 0.75rem;box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);object-fit: cover;" /></p>
<h3 class="step_code">Setup Pusher &#038; Echo Server</h3>
<p>For setup Pusher &#038; Echo server you need to run the following command.<br />
Generate broadcasting:</p>
<pre class="brush: php; title: ; notranslate">
php artisan install:broadcasting
</pre>
<p>Now, we will install pusher-php-server to use driver as pusher, so let&#8217;s run the given command:</p>
<pre class="brush: php; title: ; notranslate">
composer require pusher/pusher-php-server
</pre>
<p>Now, we will install laravel echo server. so, let&#8217;s run the below commands:</p>
<pre class="brush: php; title: ; notranslate">
npm install --save-dev laravel-echo pusher-js
</pre>
<p>Now, you will see echo.js file. where you can make a changes:<br />
<strong>resources/js/echo.js</strong></p>
<pre class="brush: php; title: ; notranslate">
import Echo from &#039;laravel-echo&#039;;
 
import Pusher from &#039;pusher-js&#039;;
window.Pusher = Pusher;
 
window.Echo = new Echo({
    broadcaster: &#039;pusher&#039;,
    key: import.meta.env.VITE_PUSHER_APP_KEY,
    cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
    forceTLS: false
});
</pre>
<p><strong>.env</strong></p>
<pre class="brush: php; title: ; notranslate">
BROADCAST_CONNECTION=pusher

PUSHER_APP_ID=&quot;1822914&quot;
PUSHER_APP_KEY=&quot;b47df8a8ea52a814246e&quot;
PUSHER_APP_SECRET=&quot;5f9397a869...&quot;
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=&quot;https&quot;
PUSHER_APP_CLUSTER=&quot;ap2&quot;

VITE_APP_NAME=&quot;${APP_NAME}&quot;
VITE_PUSHER_APP_KEY=&quot;${PUSHER_APP_KEY}&quot;
VITE_PUSHER_HOST=&quot;${PUSHER_HOST}&quot;
VITE_PUSHER_PORT=&quot;${PUSHER_PORT}&quot;
VITE_PUSHER_SCHEME=&quot;${PUSHER_SCHEME}&quot;
VITE_PUSHER_APP_CLUSTER=&quot;${PUSHER_APP_CLUSTER}&quot;
</pre>
<p>Now again run build command:</p>
<pre class="brush: php; title: ; notranslate">
npm run build
</pre>
<h3 class="step_code"> Create PostCreate Event</h3>
<p>In this step, we need to create &#8220;Event&#8221;. so let&#8217;s run the command below.</p>
<pre class="brush: php; title: ; notranslate">
php artisan make:event PostCreate
</pre>
<p>Now, you will see a new folder created as &#8220;Events&#8221;. where you can make a changes:<br />
<strong>app/Events/PostCreate.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;

class PostCreate implements ShouldBroadcastNow
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

     public $post;

    /**
     * Create a new event instance.
     */
    public function __construct($post)
    {
        $this-&gt;post = $post;
    }

    /**
     * Write code on Method
     *
     * @return response()
     */
    public function broadcastOn()
    {
        return new Channel(&#039;posts&#039;);
    }

    /**
     * Write code on Method
     *
     * @return response()
     */
    public function broadcastAs()
    {
        return &#039;create&#039;;
    }

    /**
     * Get the data to broadcast.
     *
     * @return array
     */
    public function broadcastWith(): array
    {
        return &#x5B;
            &#039;message&#039; =&gt; &quot;&#x5B;{$this-&gt;post-&gt;created_at}] New Post Received with title &#039;{$this-&gt;post-&gt;title}&#039;.&quot;
        ];
    }
}
</pre>
<h3 class="step_code">Create Routes</h3>
<p>now we need to create some routes. so, add some the following routes. </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\PostController;

Route::get(&#039;/&#039;, function () {
    return view(&#039;welcome&#039;);
});

Auth::routes();

Route::get(&#039;/home&#039;, &#x5B;App\Http\Controllers\HomeController::class, &#039;index&#039;])-&gt;name(&#039;home&#039;);

Route::get(&#039;/posts&#039;, &#x5B;PostController::class, &#039;index&#039;])-&gt;name(&#039;posts.index&#039;);
Route::post(&#039;/posts&#039;, &#x5B;PostController::class, &#039;store&#039;])-&gt;name(&#039;posts.store&#039;);
</pre>
<h3 class="step_code">Create Controller</h3>
<p><strong>app/Http/Controllers/PostController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Post;
use App\Events\PostCreate;

class PostController extends Controller
{
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function index(Request $request)
    {
        $posts = Post::get();

        return view(&#039;posts&#039;, compact(&#039;posts&#039;));
    }

    /**
     * Write code on Method
     *
     * @return response()
     */
    public function store(Request $request)
    {
        $this-&gt;validate($request, &#x5B;
             &#039;title&#039; =&gt; &#039;required&#039;,
             &#039;body&#039; =&gt; &#039;required&#039;
        ]);
   
        $post = Post::create(&#x5B;
            &#039;user_id&#039; =&gt; auth()-&gt;id(),
            &#039;title&#039; =&gt; $request-&gt;title,
            &#039;body&#039; =&gt; $request-&gt;body
        ]);

        event(new PostCreate($post));
   
        return back()-&gt;with(&#039;success&#039;,&#039;Post created successfully.&#039;);
    }
}
</pre>
<h3 class="step_code">Create and Update Blade Files</h3>
<p>Now, we will update app.blade.php file and create posts.blade file.<br />
<strong>resources/views/layouts/app.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!doctype html&gt;
&lt;html lang=&quot;{{ str_replace(&#039;_&#039;, &#039;-&#039;, app()-&gt;getLocale()) }}&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;utf-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;

    &lt;!-- CSRF Token --&gt;
    &lt;meta name=&quot;csrf-token&quot; content=&quot;{{ csrf_token() }}&quot;&gt;

    &lt;title&gt;{{ config(&#039;app.name&#039;, &#039;Laravel&#039;) }}&lt;/title&gt;

    &lt;!-- Fonts --&gt;
    &lt;link rel=&quot;dns-prefetch&quot; href=&quot;//fonts.bunny.net&quot;&gt;
    &lt;link href=&quot;https://fonts.bunny.net/css?family=Nunito&quot; rel=&quot;stylesheet&quot;&gt;

    &lt;!-- Scripts --&gt;
    @vite(&#x5B;&#039;resources/sass/app.scss&#039;, &#039;resources/js/app.js&#039;])
    
    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css&quot; /&gt;
    @yield(&#039;script&#039;)
&lt;/head&gt;
&lt;body&gt;
    &lt;div id=&quot;app&quot;&gt;
        &lt;nav class=&quot;navbar navbar-expand-md navbar-light bg-white shadow-sm&quot;&gt;
            &lt;div class=&quot;container&quot;&gt;
                &lt;a class=&quot;navbar-brand&quot; href=&quot;{{ url(&#039;/&#039;) }}&quot;&gt;
                    Laravel Send Realtime Notification using Pusher
                &lt;/a&gt;
                &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#navbarSupportedContent&quot; aria-controls=&quot;navbarSupportedContent&quot; aria-expanded=&quot;false&quot; aria-label=&quot;{{ __(&#039;Toggle navigation&#039;) }}&quot;&gt;
                    &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
                &lt;/button&gt;

                &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarSupportedContent&quot;&gt;
                    &lt;!-- Left Side Of Navbar --&gt;
                    &lt;ul class=&quot;navbar-nav me-auto&quot;&gt;

                    &lt;/ul&gt;

                    &lt;!-- Right Side Of Navbar --&gt;
                    &lt;ul class=&quot;navbar-nav ms-auto&quot;&gt;
                        &lt;!-- Authentication Links --&gt;
                        @guest
                            @if (Route::has(&#039;login&#039;))
                                &lt;li class=&quot;nav-item&quot;&gt;
                                    &lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&#039;login&#039;) }}&quot;&gt;{{ __(&#039;Login&#039;) }}&lt;/a&gt;
                                &lt;/li&gt;
                            @endif

                            @if (Route::has(&#039;register&#039;))
                                &lt;li class=&quot;nav-item&quot;&gt;
                                    &lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&#039;register&#039;) }}&quot;&gt;{{ __(&#039;Register&#039;) }}&lt;/a&gt;
                                &lt;/li&gt;
                            @endif
                        @else
                            &lt;li class=&quot;nav-item&quot;&gt;
                                &lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&#039;posts.index&#039;) }}&quot;&gt;{{ __(&#039;Posts&#039;) }}&lt;/a&gt;
                            &lt;/li&gt;
                            &lt;li class=&quot;nav-item dropdown&quot;&gt;
                                &lt;a id=&quot;navbarDropdown&quot; class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; role=&quot;button&quot; data-bs-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot; v-pre&gt;
                                    {{ Auth::user()-&gt;name }}
                                &lt;/a&gt;

                                &lt;div class=&quot;dropdown-menu dropdown-menu-end&quot; aria-labelledby=&quot;navbarDropdown&quot;&gt;
                                    &lt;a class=&quot;dropdown-item&quot; href=&quot;{{ route(&#039;logout&#039;) }}&quot;
                                       onclick=&quot;event.preventDefault();
                                                     document.getElementById(&#039;logout-form&#039;).submit();&quot;&gt;
                                        {{ __(&#039;Logout&#039;) }}
                                    &lt;/a&gt;

                                    &lt;form id=&quot;logout-form&quot; action=&quot;{{ route(&#039;logout&#039;) }}&quot; method=&quot;POST&quot; class=&quot;d-none&quot;&gt;
                                        @csrf
                                    &lt;/form&gt;
                                &lt;/div&gt;
                            &lt;/li&gt;
                        @endguest
                    &lt;/ul&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/nav&gt;

        &lt;main class=&quot;py-4&quot;&gt;
            @yield(&#039;content&#039;)
        &lt;/main&gt;
    &lt;/div&gt;
&lt;/body&gt;

&lt;/html&gt;
</pre>
<p><strong>resources/views/posts.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
@extends(&#039;layouts.app&#039;)

@section(&#039;content&#039;)
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row justify-content-center&quot;&gt;
        &lt;div class=&quot;col-md-12&quot;&gt;
            &lt;div class=&quot;card&quot;&gt;
                &lt;div class=&quot;card-header&quot;&gt;&lt;i class=&quot;fa fa-list&quot;&gt;&lt;/i&gt; {{ __(&#039;Posts List&#039;) }}&lt;/div&gt;

                &lt;div class=&quot;card-body&quot;&gt;
                    @session(&#039;success&#039;)
                        &lt;div class=&quot;alert alert-success&quot; role=&quot;alert&quot;&gt; 
                            {{ $value }}
                        &lt;/div&gt;
                    @endsession

                    &lt;div id=&quot;notification&quot;&gt;
                        
                    &lt;/div&gt;
                    
                    @if(!auth()-&gt;user()-&gt;is_admin)
                    &lt;p&gt;&lt;strong&gt;Create New Post&lt;/strong&gt;&lt;/p&gt;
                    &lt;form method=&quot;post&quot; action=&quot;{{ route(&#039;posts.store&#039;) }}&quot; enctype=&quot;multipart/form-data&quot;&gt;
                        @csrf
                        &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label&gt;Title:&lt;/label&gt;
                            &lt;input type=&quot;text&quot; name=&quot;title&quot; class=&quot;form-control&quot; /&gt;
                            @error(&#039;title&#039;)
                                &lt;div class=&quot;text-danger&quot;&gt;{{ $message }}&lt;/div&gt;
                            @enderror
                        &lt;/div&gt;
                        &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label&gt;Body:&lt;/label&gt;
                            &lt;textarea class=&quot;form-control&quot; name=&quot;body&quot;&gt;&lt;/textarea&gt;
                            @error(&#039;body&#039;)
                                &lt;div class=&quot;text-danger&quot;&gt;{{ $message }}&lt;/div&gt;
                            @enderror
                        &lt;/div&gt;
                        &lt;div class=&quot;form-group mt-2&quot;&gt;
                            &lt;button type=&quot;submit&quot; class=&quot;btn btn-success btn-block&quot;&gt;&lt;i class=&quot;fa fa-save&quot;&gt;&lt;/i&gt; Submit&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/form&gt;
                    @endif

                    &lt;p class=&quot;mt-4&quot;&gt;&lt;strong&gt;Post List:&lt;/strong&gt;&lt;/p&gt;
                    &lt;table class=&quot;table table-bordered data-table&quot;&gt;
                        &lt;thead&gt;
                            &lt;tr&gt;
                                &lt;th width=&quot;70px&quot;&gt;ID&lt;/th&gt;
                                &lt;th&gt;Title&lt;/th&gt;
                                &lt;th&gt;Body&lt;/th&gt;
                            &lt;/tr&gt;
                        &lt;/thead&gt;
                        &lt;tbody&gt;
                            @forelse($posts as $post)
                                &lt;tr&gt;
                                    &lt;td&gt;{{ $post-&gt;id }}&lt;/td&gt;
                                    &lt;td&gt;{{ $post-&gt;title }}&lt;/td&gt;
                                    &lt;td&gt;{{ $post-&gt;body }}&lt;/td&gt;
                                &lt;/tr&gt;
                            @empty
                                &lt;tr&gt;
                                    &lt;td colspan=&quot;5&quot;&gt;There are no posts.&lt;/td&gt;
                                &lt;/tr&gt;
                            @endforelse
                        &lt;/tbody&gt;
                    &lt;/table&gt;

                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
@endsection

@section(&#039;script&#039;)
@if(auth()-&gt;user()-&gt;is_admin)
    &lt;script type=&quot;module&quot;&gt;
            window.Echo.channel(&#039;posts&#039;)
                .listen(&#039;.create&#039;, (data) =&gt; {
                    console.log(&#039;Order status updated: &#039;, data);
                    var d1 = document.getElementById(&#039;notification&#039;);
                    d1.insertAdjacentHTML(&#039;beforeend&#039;, &#039;&lt;div class=&quot;alert alert-success alert-dismissible fade show&quot;&gt;&lt;span&gt;&lt;i class=&quot;fa fa-circle-check&quot;&gt;&lt;/i&gt;  &#039;+data.message+&#039;&lt;/span&gt;&lt;/div&gt;&#039;);
                });
    &lt;/script&gt;
@endif
@endsection
</pre>
<h3 class="step_code"> Create Admin User</h3>
<p>To create admin user we need to create seeder. so run this command.<br />
Let&#8217;s run the migration command:</p>
<pre class="brush: php; title: ; notranslate">
php artisan make:seeder CreateAdminUser
</pre>
<p>Now, we need to do some changes in CreateAdminUser seeder.<br />
<strong>database/seeders/CreateAdminUser.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\User;

class CreateAdminUser extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        User::create(&#x5B;
            &#039;name&#039; =&gt; &#039;Admin&#039;,
            &#039;email&#039; =&gt; &#039;admin@gmail.com&#039;,
            &#039;password&#039; =&gt; bcrypt(&#039;123456&#039;),
            &#039;is_admin&#039; =&gt; 1
        ]);
    }
}
</pre>
<p>now, the run seeder using the below command:</p>
<pre class="brush: php; title: ; notranslate">
php artisan db:seed --class=CreateAdminUser
</pre>
<p><strong>Run Laravel App:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<p>Now, you have one admin user and you can register another normal user from registration form.<br />
Now, when you post then admin user will get the notification.</p>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-send-real-time-notifications-using-pusher-example-in-laravel-12/">How to send Real-Time Notifications using Pusher Example in Laravel 12</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-send-real-time-notifications-using-pusher-example-in-laravel-12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install React Js</title>
		<link>https://codeplaners.com/how-to-install-react-js/</link>
					<comments>https://codeplaners.com/how-to-install-react-js/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 19 Jun 2025 04:33:53 +0000</pubDate>
				<category><![CDATA[Reacts]]></category>
		<category><![CDATA[reactjs]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1758</guid>

					<description><![CDATA[<p>Hi Dev, To Install React.js on your Windows system, follow these steps. There are two Methods to Install react.js In our blog, we clearly explained two ways to setup React.js: First, the modern and lightweight option—Vite. Second, the traditional but now considered deprecated way—Create React App (CRA)— Method &#8211; 1 Install Node.js and npm Download &#8230; <a href="https://codeplaners.com/how-to-install-react-js/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Install React Js"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-react-js/">How to Install React Js</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p> To Install React.js on your Windows system, follow these steps. There are two Methods to Install react.js</p>
<p>In our blog, we clearly explained two ways to setup React.js: First, the modern and lightweight option—Vite.<br />
 Second, the traditional but now considered deprecated way—Create React App (CRA)— </p>
<p><strong>Method &#8211; 1</strong></p>
<h3 class="step_code">Install Node.js and npm</h3>
<p><strong>Download Node.js <a href="https://nodejs.org/" style="color: #0551dc;">official Node.js website</a></strong><br />
<strong>Install Node.js</strong></p>
<p><strong>Verify Installation</strong></p>
<ul>
<li>Open Command Prompt or PowerShell.</li>
<li>Check Node.js version:</li>
<pre class="brush: jscript; title: ; notranslate">
node -v
</pre>
<li>Check npm version:</li>
<pre class="brush: jscript; title: ; notranslate">
npm -v
</pre>
</ul>
<h3 class="step_code"> Create a New React Application( Using Vite(Recommended))</h3>
<p><strong>Create a React App with Vite</strong></p>
<pre class="brush: jscript; title: ; notranslate">
npm create vite@latest my-app -- --template react
</pre>
<p><strong>Navigate to the Project Directory</strong></p>
<pre class="brush: jscript; title: ; notranslate">
cd my-app
</pre>
<p><strong>my-app (Project Name)</strong></p>
<p><strong>Install Dependencies</strong></p>
<pre class="brush: jscript; title: ; notranslate">
npm install
</pre>
<p><strong> Start the Development Server</strong></p>
<pre class="brush: jscript; title: ; notranslate">
npm run dev
</pre>
<p><strong>Method &#8211; 2</strong></p>
<h3 class="step_code">Install Node.js and npm</h3>
<p><strong>Download Node.js <a href="https://nodejs.org/" style="color: #0551dc;">official Node.js website</a></strong><br />
<strong>Install Node.js</strong></p>
<p><strong>Verify Installation</strong></p>
<ul>
<li>Open Command Prompt or PowerShell.</li>
<li>Check Node.js version:</li>
<pre class="brush: jscript; title: ; notranslate">
node -v
</pre>
<li>Check npm version:</li>
<pre class="brush: jscript; title: ; notranslate">
npm -v
</pre>
</ul>
<h3 class="step_code"> Create a New React Application( Using Create React App)</h3>
<p><strong>Create a React App:</strong></p>
<pre class="brush: jscript; title: ; notranslate">
npx create-react-app my-app
</pre>
<p><strong>Navigate to the Project Directory</strong></p>
<pre class="brush: jscript; title: ; notranslate">
cd my-app
</pre>
<p><strong>my-app (Project Name)</strong></p>
<p><strong>Start the Development Server:</strong></p>
<pre class="brush: jscript; title: ; notranslate">
npm start
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-install-react-js/">How to Install React Js</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-install-react-js/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Upload &#038; Store Image in Laravel</title>
		<link>https://codeplaners.com/upload-store-image-in-laravel/</link>
					<comments>https://codeplaners.com/upload-store-image-in-laravel/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 18 Jun 2025 10:39:47 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 12]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1754</guid>

					<description><![CDATA[<p>hi Dev, today in this article we will understand how to upload &#038; Store Image in Laravel. Follow a few straightforward steps to let users upload images via a Blade form and store them in Laravel’s filesystem. So let&#8217;s start : Install Laravel 12 composer create-project laravel/laravel example-image Create Model php artisan create_images_table database/migrations/create_images_table.php &#60;?php &#8230; <a href="https://codeplaners.com/upload-store-image-in-laravel/" class="more-link">Continue reading<span class="screen-reader-text"> "Upload &#038; Store Image in Laravel"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/upload-store-image-in-laravel/">Upload &#038; Store Image in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>hi Dev,<br />
today in this article we will understand how to upload &#038; Store Image in Laravel. </p>
<p>Follow a few straightforward steps to let users upload images via a Blade form and store them in Laravel’s filesystem. So let&#8217;s start :</p>
<h3 class="step_code"> Install Laravel 12</h3>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-image
</pre>
<h3 class="step_code"> Create Model</h3>
<pre class="brush: php; title: ; notranslate">
php artisan create_images_table
</pre>
<p><strong>database/migrations/create_images_table.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
   
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
   
return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create(&#039;images&#039;, function (Blueprint $table) {
            $table-&gt;id();
            $table-&gt;string(&#039;title&#039;);
            $table-&gt;string(&#039;image&#039;);
            $table-&gt;timestamps();
        });
   
        DB::statement(&quot;ALTER TABLE images ADD file MEDIUMBLOB&quot;);
    }
   
    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists(&#039;images&#039;);
    }
};
</pre>
<p><strong>app/Models/Image.php</strong></p>
<pre class="brush: plain; title: ; notranslate">
&lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


class Image extends Model
{
    
    protected $fillable = &#x5B;
        &#039;title&#039;,
        &#039;image&#039;,
    ];

    
}
</pre>
<h3 class="step_code">Create Controller</h3>
<pre class="brush: php; title: ; notranslate">
php artisan make:controller ImageController
</pre>
<p><strong>app/Http/Controllers/ImageController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Http\Controllers;
use App\Models\Image;
use Illuminate\Http\Request;

class ImageController extends Controller
{
    public function upload(Request $request)
    {
        $file = $request-&gt;file(&#039;file&#039;);
        $imgPath = time().&#039;_&#039;.$file-&gt;getClientOriginalName();
        $file-&gt;move(public_path(&#039;images/imglist&#039;), $imgPath);

        $image = new Image();
        $image-&gt;path = &#039;images/imglist/&#039; . $imgPath;
        $image-&gt;save();

        return redirect()-&gt;route(&#039;images.list&#039;)
                         -&gt;with(&#039;success&#039;, &#039;Image uploaded successfully&#039;);
    }

    public function list()
    {
        $imageData = Image::all();
        return view(&#039;display&#039;, compact(&#039;imageData&#039;));
    }
}

</pre>
<h3 class="step_code">Create Add Routes</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">

use App\Http\Controllers\ImageController;

Route::get(&#039;/images&#039;, &#x5B;ImageController::class, &#039;list&#039;])-&gt;name(&#039;images.list&#039;);
Route::post(&#039;/upload&#039;, &#x5B;ImageController::class, &#039;upload&#039;])-&gt;name(&#039;images.upload&#039;);

</pre>
<h3 class="step_code">Create Blade File</h3>
<p><strong>resources/views/addpost.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
 &lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;&lt;title&gt;Upload Image&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
  @if(session(&#039;success&#039;))
    &lt;p style=&quot;color: green;&quot;&gt;{{ session(&#039;success&#039;) }}&lt;/p&gt;
  @endif

  &lt;form action=&quot;{{ route(&#039;images.upload&#039;) }}&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;
    @csrf
    &lt;input type=&quot;file&quot; name=&quot;file&quot; required&gt;
    &lt;button type=&quot;submit&quot;&gt;Upload&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;a href=&quot;{{ route(&#039;images.list&#039;) }}&quot;&gt;View Gallery&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre>
<p><strong>resources/views/display.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;&lt;title&gt;Image Gallery&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
  &lt;h2&gt;Uploaded Images&lt;/h2&gt;
  &lt;a href=&quot;{{ url(&#039;/upload&#039;) }}&quot;&gt;Upload more&lt;/a&gt;
  &lt;div style=&quot;display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px;&quot;&gt;
    @foreach($imageData as $img)
      &lt;div style=&quot;border: 1px solid #ccc; padding: 5px;&quot;&gt;
        &lt;img src=&quot;{{ asset($img-&gt;path) }}&quot; alt=&quot;Image&quot; style=&quot;width:150px;height:auto;&quot;&gt;
      &lt;/div&gt;
    @endforeach
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre>
<h3 class="step_code">Run Laravel App:</h3>
<pre class="brush: plain; title: ; notranslate">
php artisan serve
</pre>
<p></html></p>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/upload-store-image-in-laravel/">Upload &#038; Store Image in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/upload-store-image-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
