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

<channel>
	<title>Laravel 8 Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/laravel-8/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/laravel-8/</link>
	<description>Code Solution</description>
	<lastBuildDate>Wed, 01 Jan 2025 06:41:02 +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>Laravel 8 Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/laravel-8/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Add Blade Components In Laravel 10</title>
		<link>https://codeplaners.com/how-to-add-blade-components-in-laravel-10/</link>
					<comments>https://codeplaners.com/how-to-add-blade-components-in-laravel-10/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 20 Dec 2024 03:10:43 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[blade components in laravel 10]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1664</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:38 amHi Dev, Today, we will show you how to add blade components in laravel 10. This article will give you simple example of how to add blade components in laravel 10. Let&#8217;s discuss how to add blade components in laravel 10. In this article, &#8230; <a href="https://codeplaners.com/how-to-add-blade-components-in-laravel-10/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Add Blade Components In Laravel 10"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-blade-components-in-laravel-10/">How to Add Blade Components In Laravel 10</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:38 am</p><p>Hi Dev,</p>
<p>Today, we will show you how to add blade components in laravel 10. This article will give you simple example of how to add blade components in laravel 10. Let&#8217;s discuss how to add blade components in laravel 10. In this article, we will implement a how to add blade components in laravel 10. </p>
<p><strong>What are Laravel blade components?</strong><br />
Laravel Blade components are reusable, self-contained building blocks for your views. They allow you to encapsulate UI elements, making your code cleaner, more maintainable, and promoting the concept of &#8220;Don&#8217;t Repeat Yourself&#8221; (DRY). Components are incredibly versatile and can represent anything from simple buttons to complex form elements.</p>
<h3 class="step_code">Install the Laravel 10</h3>
<pre class="brush: php; title: ; notranslate">
composer create-project --prefer-dist laravel/laravel laravel-app
cd laravel-app
</pre>
<h3 class="step_code">Create a Blade Component</h3>
<p><strong>Now, generate blade component by running the command.</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan make:component Button
cd laravel-app
</pre>
<p>&#8220;This command will create a new directory in your <strong>resources/views/components</strong> folder that will contain a blade view <strong>(button.blade.php)</strong> and the associated PHP class <strong>(button.php)</strong> within the <strong>views/components directory</strong>.</p>
<h3 class="step_code">Define the Component Blade View</h3>
<p>Navigate to the <strong>button.blade.php</strong> file located in the <strong>resources/views/components</strong> directory. Within this file, define the HTML structure and any necessary logic for your button component. For example</p>
<pre class="brush: php; title: ; notranslate">
&lt;button {{ $attributes-&gt;merge(&#x5B;'class' =&gt; 'bg-blue-500 text-white']) }}&gt;
    {{ $slot }}
&lt;/button&gt;
</pre>
<p>We take advantage of the <strong>$attributes</strong> variable to merge any additional attributes provided to the component. The <strong>$slot</strong> variable represents the content inserted within the component when used in a view.</p>
<h3 class="step_code">Use the Blade Component</h3>
<p>Now that our component is defined, let&#8217;s include it in a view. Open any Blade view (for example, <strong>resources/views/welcome.blade.php</strong>) and include your component using the <x> directive.</p>
<pre class="brush: php; title: ; notranslate">
&lt;x-button&gt;
    Click Me
&lt;/x-button&gt;
</pre>
<h3 class="step_code">Reusable Components with Parameters</h3>
<pre class="brush: php; title: ; notranslate">
&lt;x-button color=&quot;red&quot;&gt;
    Danger
&lt;/x-button&gt;
</pre>
<p>To accomplish this, access the <strong>Button.php</strong> class in the <strong>Views/Components</strong> directory and declare a public property called &#8216;color&#8217;.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class Button extends Component
{
    public $color;

    /**
    * Create a new component instance.
    */
    public function __construct($color = 'blue')
    {
        $this-&gt;color = $color;
    }

    /**
    * Get the view / contents that represent the component.
    */
    public function render(): View|Closure|string
    {
        return view('components.button');
    }
}
</pre>
<p>use the $color property inside the <strong>button.blade.php</strong> view.</p>
<pre class="brush: php; title: ; notranslate">
&lt;button {{ $attributes-&gt;merge(&#x5B;'class' =&gt; 'bg-' . $color . ' text-white']) }}&gt;
    {{ $slot }}
&lt;/button&gt;
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-blade-components-in-laravel-10/">How to Add Blade Components In Laravel 10</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-add-blade-components-in-laravel-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 10 Implement User Role and Permission Example</title>
		<link>https://codeplaners.com/laravel-10-implement-user-role-and-permission-example/</link>
					<comments>https://codeplaners.com/laravel-10-implement-user-role-and-permission-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 14 Dec 2024 12:55:20 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1658</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:38 amHi Dev, Today, we will show you laravel 10 implement user role and permission example. This article will give you simple example of laravel 10 implement user role and permission example. Let&#8217;s discuss how to set role permissions. In this article, we will implement &#8230; <a href="https://codeplaners.com/laravel-10-implement-user-role-and-permission-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 10 Implement User Role and Permission Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-implement-user-role-and-permission-example/">Laravel 10 Implement User Role and Permission Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:38 am</p><p>Hi Dev,</p>
<p>Today, we will show you laravel 10 implement user role and permission example. This article will give you simple example of laravel 10 implement user role and permission example. Let&#8217;s discuss how to set role permissions. In this article, we will implement a laravel 10 implement user role and permission example. </p>
<p>So let’s follow few step to create example of laravel 10 implement user role and permission example.</p>
<h3 class="step_code">Install the Spatie Permission package.</h3>
<pre class="brush: php; title: ; notranslate">
composer require spatie/laravel-permission
</pre>
<h3 class="step_code">Publish the package&#8217;s configuration and migration files.</h3>
<pre class="brush: php; title: ; notranslate">
php artisan vendor:publish --provider=&quot;Spatie\Permission\PermissionServiceProvider&quot;
</pre>
<h3 class="step_code">Migrate the database.</h3>
<pre class="brush: php; title: ; notranslate">
php artisan migrate
</pre>
<h3 class="step_code">Create the Role and Permission models.</h3>
<pre class="brush: php; title: ; notranslate">
php artisan make:model Role -m
php artisan make:model Permission -m
</pre>
<h3 class="step_code">Update User Model File</h3>
<pre class="brush: php; title: ; notranslate">
class User extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = &#x5B;
        'name',
        'email',
        'password',
    ];

    protected $hidden = &#x5B;
        'password',
        'remember_token',
    ];

    protected $casts = &#x5B;
        'email_verified_at' =&gt; 'datetime',
    ];

    public function roles()
    {
        return $this-&gt;belongsToMany(Role::class);
    }

    public function permissions()
    {
        return $this-&gt;belongsToMany(Permission::class);
    }
}
</pre>
<h3 class="step_code">Create Role and Permission seeders</h3>
<pre class="brush: php; title: ; notranslate">
php artisan make:seeder RoleSeeder
php artisan make:seeder PermissionSeeder
</pre>
<h3 class="step_code">RoleSeeder create some roles and add them to the database</h3>
<pre class="brush: php; title: ; notranslate">
class RoleSeeder extends Seeder
{
    public function run()
    {
        $adminRole = Role::create(&#x5B;'name' =&gt; 'admin']);
        $userRole = Role::create(&#x5B;'name' =&gt; 'user']);

        $adminRole-&gt;givePermissionTo('all');
    }
}
</pre>
<h3 class="step_code">PermissionSeeder create certain permissions and then seed them into the database.</h3>
<pre class="brush: php; title: ; notranslate">
class PermissionSeeder extends Seeder
{
    public function run()
    {
        Permission::create(&#x5B;'name' =&gt; 'view users']);
        Permission::create(&#x5B;'name' =&gt; 'create users']);
        Permission::create(&#x5B;'name' =&gt; 'edit users']);
        Permission::create(&#x5B;'name' =&gt; 'delete users']);
    }
}
</pre>
<h3 class="step_code">Run the seeders</h3>
<pre class="brush: php; title: ; notranslate">
php artisan db:seed
</pre>
<h3 class="step_code">Assign roles to users based on their responsibilities or access levels.</h3>
<pre class="brush: php; title: ; notranslate">
$user = User::find(1);
$user-&gt;assignRole('admin');
</pre>
<h3 class="step_code">Verify whether the user has a specific role or permission.</h3>
<pre class="brush: php; title: ; notranslate">
$user = User::find(1);

if ($user-&gt;hasRole('admin')) {
    // do something
}

if ($user-&gt;can('view users')) {
    // do something
}
</pre>
<h3 class="step_code">You can also use middleware for security based on user roles. For example, the following middleware will allow access to the /users root exclusively for users with the &#8216;admin&#8217; role.</h3>
<pre class="brush: php; title: ; notranslate">
Route::middleware('role:admin')-&gt;get('/users', function () {
    // ...
});
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-implement-user-role-and-permission-example/">Laravel 10 Implement User Role and Permission Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-10-implement-user-role-and-permission-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Select Option Subcategory By Category In PHP</title>
		<link>https://codeplaners.com/select-option-subcategory-by-category-in-php/</link>
					<comments>https://codeplaners.com/select-option-subcategory-by-category-in-php/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 08 Dec 2024 05:09:28 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[category by Subcategory]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 8]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1438</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:38 amHi Dev, Today, i we will show you select option subcategory by category in php. This article will give you simple example of select option subcategory by category in php. you will select option subcategory by category in php. In this article, we will &#8230; <a href="https://codeplaners.com/select-option-subcategory-by-category-in-php/" class="more-link">Continue reading<span class="screen-reader-text"> "Select Option Subcategory By Category In PHP"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/select-option-subcategory-by-category-in-php/">Select Option Subcategory By Category In PHP</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:38 am</p><p>Hi Dev,</p>
<p>Today, i we will show you select option subcategory by category in php. This article will give you simple example of select option subcategory by category in php. you will select option subcategory by category in php. In this article, we will implement a select option subcategory by category in php. </p>
<p>So let’s follow few step to create example of select option subcategory by category in php.</p>
<h3 class="step_code">database.php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	$servername = &quot;localhost&quot;;
	$username = &quot;root&quot;;
	$password = &quot;&quot;;
	$db=&quot;example&quot;;
	$conn = mysqli_connect($servername, $username, $password,$db);
?&gt;
</pre>
<h3 class="step_code">index.php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
include 'database.php';
$result = mysqli_query($conn,&quot;SELECT * FROM category&quot;);
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;title&gt;Select Option Subcategory By Category In PHP - Codeplaners&lt;/title&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;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css&quot;&gt;
  &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
	&lt;form&gt;
		&lt;div class=&quot;form-group&quot;&gt;
		  &lt;label &gt;Category&lt;/label&gt;
		  &lt;select class=&quot;form-control&quot; id=&quot;category&quot;&gt;
		  &lt;option value=&quot;&quot;&gt;Select Category&lt;/option&gt;
		    &lt;?php
			while($row = mysqli_fetch_array($result)) {
			?&gt;
				&lt;option value=&quot;&lt;?php echo $row&#x5B;&quot;id&quot;];?&gt;&quot;&gt;&lt;?php echo $row&#x5B;&quot;category_name&quot;];?&gt;&lt;/option&gt;
			&lt;?php
			}
			?&gt;
			
		  &lt;/select&gt;
		&lt;/div&gt;
		&lt;div class=&quot;form-group&quot;&gt;
		  &lt;label for=&quot;sel1&quot;&gt;Sub Category&lt;/label&gt;
		  &lt;select class=&quot;form-control&quot; id=&quot;sub_category&quot;&gt;
			
		  &lt;/select&gt;
		&lt;/div&gt;
	&lt;/form&gt;
&lt;/div&gt;
&lt;script&gt;
$(document).ready(function() {
	$('#category').on('change', function() {
			var category_id = this.value;
			$.ajax({
				url: &quot;get_subcat.php&quot;,
				type: &quot;POST&quot;,
				data: {
					category_id: category_id
				},
				cache: false,
				success: function(dataResult){
					$(&quot;#sub_category&quot;).html(dataResult);
				}
			});
		
		
	});
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3 class="step_code">get_subcat.php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	include 'database.php';
	$category_id=$_POST&#x5B;&quot;category_id&quot;];
	$result = mysqli_query($conn,&quot;SELECT * FROM category where category_id=$category_id&quot;);
?&gt;
&lt;option value=&quot;&quot;&gt;Select SubCategory&lt;/option&gt;
&lt;?php
while($row = mysqli_fetch_array($result)) {
?&gt;
	&lt;option value=&quot;&lt;?php echo $row&#x5B;&quot;id&quot;];?&gt;&quot;&gt;&lt;?php echo $row&#x5B;&quot;subcategory_name&quot;];?&gt;&lt;/option&gt;
&lt;?php
}
?&gt;
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/select-option-subcategory-by-category-in-php/">Select Option Subcategory By Category In PHP</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/select-option-subcategory-by-category-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Set Indian Timezone in Laravel</title>
		<link>https://codeplaners.com/set-indian-timezone-in-laravel/</link>
					<comments>https://codeplaners.com/set-indian-timezone-in-laravel/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 06 Dec 2024 15:53:58 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[Laravel 11]]></category>
		<category><![CDATA[timezone]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1740</guid>

					<description><![CDATA[<p>Hi Dev, In this post, I will show you how to set Indian time zone in Laravel By default, Laravel uses UTC time zone. We can set it for India or any other country. Here we are showing you how to set Indian time zone. Let&#8217;s set the Indian time zone to `Asia/Kolkata`. We can &#8230; <a href="https://codeplaners.com/set-indian-timezone-in-laravel/" class="more-link">Continue reading<span class="screen-reader-text"> "Set Indian Timezone in Laravel"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/set-indian-timezone-in-laravel/">Set Indian Timezone in Laravel</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 post, I will show you how to set Indian time zone in Laravel</p>
<p>By default, Laravel uses UTC time zone. We can set it for India or any other country. Here we are showing you how to set Indian time zone. Let&#8217;s set the Indian time zone to `Asia/Kolkata`. We can apply this time zone in two ways:</p>
<h3 class="step_code">Step 1: Update timezone .env file</h3>
<p>.env</p>
<pre class="brush: php; title: ; notranslate">
APP_TIMEZONE=&quot;Asia/Kolkata&quot;
</pre>
<h3 class="step_code">Step 2: Update timezone config file</h3>
<pre class="brush: php; title: ; notranslate">
'timezone' =&gt; 'Asia/Kolkata',
</pre>
<p>You can find out if the time zone is set correctly by following route code</p>
<pre class="brush: php; title: ; notranslate">
Route::get('/', function () {
    dd(now());
});
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/set-indian-timezone-in-laravel/">Set Indian Timezone in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/set-indian-timezone-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Add DomPDF Add QR Code to PDF in Laravel</title>
		<link>https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/</link>
					<comments>https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 09 Nov 2024 03:43:45 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[DomPDF]]></category>
		<category><![CDATA[DomPDF in laravel]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1653</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you how to add DomPDF add QR Code to PDF in laravel. In this article will tell you how to add DomPDF add QR Code to PDF in laravel. you will how to add DomPDF add QR Code to &#8230; <a href="https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Add DomPDF Add QR Code to PDF in Laravel"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/">How to Add DomPDF Add QR Code to PDF in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you how to add DomPDF add QR Code to PDF in laravel. In this article will tell you how to add DomPDF add QR Code to PDF in laravel. you will how to add DomPDF add QR Code to PDF in laravel. I will show in this example how to integrate QR code PDF. For this we will use two composer packages.</p>
<p>You can also use this example with Laravel 6, Laravel 7, Laravel 8, Laravel 9 and Laravel 10 versions.</p>
<p>So, let’s follow few steps to create example of how to add DomPDF add QR Code to PDF in laravel.</p>
<h3 class="step_code">Step 1: Install Laravel App</h3>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-qrcode
</pre>
<h3 class="step_code">Step 2: Install DomPDF Package</h3>
<pre class="brush: php; title: ; notranslate">
composer require barryvdh/laravel-dompdf
</pre>
<pre class="brush: php; title: ; notranslate">
composer require simplesoftwareio/simple-qrcode
</pre>
<h3 class="step_code">Step 3: Create Controller</h3>
<pre class="brush: php; title: ; notranslate">
php artisan make:controller PDFController
</pre>
<p><strong>app/Http/Controllers/PDFController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
namespace App\Http\Controllers;
    
use Illuminate\Http\Request;
use PDF;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
    
class PDFController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function generatePDF()
    {
        $qrcode = base64_encode(QrCode::format('svg')-&gt;size(200)-&gt;errorCorrection('H')-&gt;generate('string'));
        $data = &#x5B;
            'title' =&gt; 'Welcome to Codeplaners.com',
            'qrcode' =&gt; $qrcode
        ]; 
              
        $pdf = PDF::loadView('myPDF', $data);
  
        return $pdf-&gt;download('codeplaners.pdf');
    }
}
</pre>
<h3 class="step_code">Step 4: Add Route</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
use Illuminate\Support\Facades\Route;
  
use App\Http\Controllers\PDFController;

  
Route::get('generate-pdf', &#x5B;PDFController::class, 'generatePDF']);
</pre>
<h3 class="step_code">Step 5: Create View File</h3>
<p><strong>resources/views/myPDF.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;How to Add DomPDF Add QR Code to PDF in Laravel - codeplaners.com&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  
&lt;div&gt;
    &lt;h1&gt;How to Add DomPDF Add QR Code to PDF in Laravel&lt;/h1&gt;
      
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

Ezoic
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
  
    &lt;img src=&quot;data:image/png;base64,{{ $qrcode }}&quot; alt=&quot;&quot;&gt;
    
&lt;/div&gt;
    
&lt;/body&gt;
&lt;/html&gt;	
</pre>
<h3 class="step_code">Run Laravel App:</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<pre class="brush: php; title: ; notranslate">
http://localhost:8000/generate-pdf
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/">How to Add DomPDF Add QR Code to PDF in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 10 map() function Add Attribute Example</title>
		<link>https://codeplaners.com/laravel-10-map-function-add-attribute-example/</link>
					<comments>https://codeplaners.com/laravel-10-map-function-add-attribute-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 07 Nov 2024 03:08:06 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[map() function]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1650</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you laravel 10 map() function add attribute example. In this article will tell you laravel 10 map() function add attribute example. you will laravel 10 map() function add attribute example. You can also use this example with Laravel 6, &#8230; <a href="https://codeplaners.com/laravel-10-map-function-add-attribute-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 10 map() function Add Attribute Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-map-function-add-attribute-example/">Laravel 10 map() function Add Attribute Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you laravel 10 map() function add attribute example. In this article will tell you laravel 10 map() function add attribute example. you will laravel 10 map() function add attribute example. </p>
<p>You can also use this example with Laravel 6, Laravel 7, Laravel 8, Laravel 9 and Laravel 10 versions.</p>
<p>If we are posting with status and you need to set label on status like &#8220;0&#8221; means &#8220;Inactive&#8221; and &#8220;1&#8221; means &#8220;Active&#8221;, then you can do it using laravel collection map() function.</p>
<p>So, let’s follow few steps to create example of laravel 10 map() function add attribute example.</p>
<h3 class="step_code">Example 1: setAttribute()</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
  
namespace App\Http\Controllers;
  
use Illuminate\Http\Request;
use App\Models\User;
  
class DemoController extends Controller
{
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function index(Request $request)
    {
        $user = User::first();
  
        $user-&gt;setAttribute('position', 'Web Developer');
  
        dd($user-&gt;toArray());
    }
}
</pre>
<h3 class="step_code">Output:</h3>
<pre class="brush: php; title: ; notranslate">
array:8 &#x5B;

  &quot;id&quot; =&gt; 1

  &quot;name&quot; =&gt; &quot;Mohan&quot;

  &quot;email&quot; =&gt; &quot;codeplaners@gmail.com&quot;

  &quot;email_verified_at&quot; =&gt; null

  &quot;created_at&quot; =&gt; &quot;2022-06-23T07:02:17.000000Z&quot;

  &quot;updated_at&quot; =&gt; &quot;2022-06-23T07:02:17.000000Z&quot;

  &quot;birthdate&quot; =&gt; &quot;1998-11-15&quot;

  &quot;position&quot; =&gt; &quot;Web Developer&quot;

]
</pre>
<h3 class="step_code">Example 2: map()</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
  
namespace App\Http\Controllers;
  
use Illuminate\Http\Request;
use Illuminate\Support\Str;
  
class DemoController extends Controller
{
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function index(Request $request)
    {
        $posts = collect(&#x5B;
            &#x5B;'id'=&gt;1,'title'=&gt;'Post One'],
            &#x5B;'id'=&gt;2,'title'=&gt;'Post Two'],
            &#x5B;'id'=&gt;3,'title'=&gt;'Post Three'],
            &#x5B;'id'=&gt;4,'title'=&gt;'Post Four'],
        ]);
   
        $posts = $posts-&gt;map(function ($post) {
            $post&#x5B;'url'] = url(&quot;post/&quot;. Str::slug($post&#x5B;'title']));
            return $post;
        });
  
        dd($posts-&gt;toArray());
    }
}
</pre>
<h3 class="step_code">Output:</h3>
<pre class="brush: php; title: ; notranslate">
Array

(

    &#x5B;0] =&gt; Array

        (

            &#x5B;id] =&gt; 1

            &#x5B;title] =&gt; Post One

            &#x5B;url] =&gt; http://localhost:8000/post/post-one

        )

    &#x5B;1] =&gt; Array

        (

            &#x5B;id] =&gt; 2

            &#x5B;title] =&gt; Post Two

            &#x5B;url] =&gt; http://localhost:8000/post/post-two

        )

    &#x5B;2] =&gt; Array

        (

            &#x5B;id] =&gt; 3

            &#x5B;title] =&gt; Post Three

            &#x5B;url] =&gt; http://localhost:8000/post/post-three

        )

    &#x5B;3] =&gt; Array

        (

            &#x5B;id] =&gt; 4

            &#x5B;title] =&gt; Post Four

            &#x5B;url] =&gt; http://localhost:8000/post/post-four

        )

)
</pre>
<h3 class="step_code">Example 3: Laravel 10 Eloquent Collection Add Attribute using map()</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
  
namespace App\Http\Controllers;
  
use Illuminate\Http\Request;
use App\Models\Post;
  
class DemoController extends Controller
{
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function index(Request $request)
    {
        $posts = Post::select(&quot;id&quot;, &quot;title&quot;, &quot;status&quot;)-&gt;take(5)-&gt;get();
  
        $posts = $posts-&gt;map(function ($post) {
            $post-&gt;status_label = $post-&gt;status == 1 ? 'Active' : 'InActive';
            return $post;
        });
  
        dd($posts-&gt;toArray());
    }
}
</pre>
<h3 class="step_code">Output:</h3>
<pre class="brush: php; title: ; notranslate">
Array

(

    &#x5B;0] =&gt; Array

        (

            &#x5B;id] =&gt; 2

            &#x5B;title] =&gt; Demo Updated

            &#x5B;status] =&gt; 1

            &#x5B;status_label] =&gt; Active

        )

    &#x5B;1] =&gt; Array

        (

            &#x5B;id] =&gt; 3

            &#x5B;title] =&gt; Dr.

            &#x5B;status] =&gt; 0

            &#x5B;status_label] =&gt; InActive

        )

    &#x5B;2] =&gt; Array

        (

            &#x5B;id] =&gt; 4

            &#x5B;title] =&gt; Miss

            &#x5B;status] =&gt; 0

            &#x5B;status_label] =&gt; InActive

        )

    &#x5B;3] =&gt; Array

        (

            &#x5B;id] =&gt; 5

            &#x5B;title] =&gt; Dr.

            &#x5B;status] =&gt; 0

            &#x5B;status_label] =&gt; InActive

        )

    &#x5B;4] =&gt; Array

        (

            &#x5B;id] =&gt; 6

            &#x5B;title] =&gt; Mrs.

            &#x5B;status] =&gt; 0

            &#x5B;status_label] =&gt; InActive

        )

)
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-map-function-add-attribute-example/">Laravel 10 map() function Add Attribute Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-10-map-function-add-attribute-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 10 Sort By Date Example</title>
		<link>https://codeplaners.com/laravel-10-sort-by-date-example/</link>
					<comments>https://codeplaners.com/laravel-10-sort-by-date-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 07 Nov 2024 02:42:29 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[Laravel 10 Sort By Date]]></category>
		<category><![CDATA[Sort By Date]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1647</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you laravel 10 sort by date example. In this article will tell you laravel 10 sort by date example. you will laravel 10 sort by date example. We will use sortBy() method to sort by date in Laravel 10. &#8230; <a href="https://codeplaners.com/laravel-10-sort-by-date-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 10 Sort By Date Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-sort-by-date-example/">Laravel 10 Sort By Date Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you laravel 10 sort by date example. In this article will tell you laravel 10 sort by date example. you will laravel 10 sort by date example. </p>
<p>We will use sortBy() method to sort by date in Laravel 10. I will give you simple two examples with output so that you can understand from tick.</p>
<p>So, let’s follow few steps to create example of laravel 10 sort by date example.</p>
<h3 class="step_code">Example 1:</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
     
namespace App\Http\Controllers;
    
use Illuminate\Http\Request;
    
class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $collection = collect(&#x5B;
            &#x5B;'id' =&gt; 1, 'name' =&gt; 'codeplaners', 'created_at' =&gt; '2023-11-07'],
            &#x5B;'id' =&gt; 2, 'name' =&gt; 'mohan', 'created_at' =&gt; '2023-11-08'],
            &#x5B;'id' =&gt; 3, 'name' =&gt; 'brijesh', 'created_at' =&gt; '2023-11-05'],
            &#x5B;'id' =&gt; 4, 'name' =&gt; 'krishan', 'created_at' =&gt; '2023-11-04'],
        ]);
  
        $sorted = $collection-&gt;sortBy('created_at');
  
        $sorted = $sorted-&gt;all();
      
        dd($sorted);
    }
}
</pre>
<h3 class="step_code">Output:</h3>
<pre class="brush: php; title: ; notranslate">
Array

(

    &#x5B;3] =&gt; Array

        (

            &#x5B;id] =&gt; 4

            &#x5B;name] =&gt; krishan

            &#x5B;created_at] =&gt; 2023-11-04

        )

    &#x5B;2] =&gt; Array

        (

            &#x5B;id] =&gt; 3

            &#x5B;name] =&gt; brijesh

            &#x5B;created_at] =&gt; 2023-11-05

        )

    &#x5B;0] =&gt; Array

        (

            &#x5B;id] =&gt; 1

            &#x5B;name] =&gt; codeplaners

            &#x5B;created_at] =&gt; 2023-11-07

        )

    &#x5B;1] =&gt; Array

        (

            &#x5B;id] =&gt; 2

            &#x5B;name] =&gt; mohan

            &#x5B;created_at] =&gt; 2023-11-08

        )

)
</pre>
<h3 class="step_code">Example 2:</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
     
namespace App\Http\Controllers;
    
use Illuminate\Http\Request;
    
class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $collection = collect(&#x5B;'2023-11-07', '2023-11-08', '2023-11-05', '2023-11-04']);
    
        $sorted = $collection-&gt;sortBy(function ($date) {
            return \Carbon\Carbon::createFromFormat('Y-m-d', $date);
        });
      
        $sorted = $sorted-&gt;all();
      
        dd($sorted);
    }
}
</pre>
<h3 class="step_code">Output:</h3>
<pre class="brush: php; title: ; notranslate">
Array

(

    &#x5B;3] =&gt; 2023-11-04

    &#x5B;2] =&gt; 2023-11-05

    &#x5B;0] =&gt; 2023-11-07

    &#x5B;1] =&gt; 2023-11-08

)
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-sort-by-date-example/">Laravel 10 Sort By Date Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-10-sort-by-date-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Upload Files to MySQL Database in Laravel 10</title>
		<link>https://codeplaners.com/how-to-upload-files-to-mysql-database-in-laravel-10/</link>
					<comments>https://codeplaners.com/how-to-upload-files-to-mysql-database-in-laravel-10/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 21 Sep 2024 05:27:00 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1633</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you how to upload files to MySQL database in laravel 10. In this article will tell you how to upload files to MySQL database in laravel 10. you will how to upload files to MySQL database in laravel 10. &#8230; <a href="https://codeplaners.com/how-to-upload-files-to-mysql-database-in-laravel-10/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Upload Files to MySQL Database in Laravel 10"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-upload-files-to-mysql-database-in-laravel-10/">How to Upload Files to MySQL Database in Laravel 10</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you how to upload files to MySQL database in laravel 10. In this article will tell you how to upload files to MySQL database in laravel 10. you will how to upload files to MySQL database in laravel 10. </p>
<p>So, let’s follow few steps to create example of how to upload files to MySQL database in laravel 10.</p>
<h3 class="step_code">Step 1: Install Laravel</h3>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-blog
</pre>
<h3 class="step_code">Step 2: Create Table and Model</h3>
<pre class="brush: php; title: ; notranslate">
php artisan create_files_table
</pre>
<p><strong>database/migrations/migration_file.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('files', function (Blueprint $table) {
            $table-&gt;id();
            $table-&gt;string('name');
            $table-&gt;string('mime');
            $table-&gt;timestamps();
        });
  
        DB::statement(&quot;ALTER TABLE files ADD file MEDIUMBLOB&quot;);
    }
  
    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('files');
    }
};
</pre>
<h3 class="step_code">Step 3: Create Controller</h3>
<pre class="brush: php; title: ; notranslate">
php artisan make:controller FileController
</pre>
<p><strong>app/Http/Controllers/FileController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
      
namespace App\Http\Controllers;
       
use Illuminate\Http\Request;
use Illuminate\View\View;
use Illuminate\Http\RedirectResponse;
use App\Models\File;
      
class FileController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(): View
    {
        $files = File::latest()-&gt;get();
        return view('fileUpload', compact('files'));
    }
        
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request): RedirectResponse
    {
        $request-&gt;validate(&#x5B;
            'file' =&gt; 'mimes:jpeg,bmp,png,pdf,jpg',
            'name' =&gt; 'required|max:255',
        ]);
        
        if ($request-&gt;hasFile('file')) {           
            $path = $request-&gt;file('file')-&gt;getRealPath();
            $ext = $request-&gt;file-&gt;extension();
            $doc = file_get_contents($path);
            $base64 = base64_encode($doc);
            $mime = $request-&gt;file('file')-&gt;getClientMimeType();
  
            File::create(&#x5B;
                'name'=&gt; $request-&gt;name .'.'.$ext,
                'file' =&gt; $base64,
                'mime'=&gt; $mime,
            ]);
        }
         
        return back()
            -&gt;with('success','You have successfully upload file.');
     
    }
}
</pre>
<h3 class="step_code">Step 4: Create Add Routes</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
  
use Illuminate\Support\Facades\Route;
  
use App\Http\Controllers\FileController;
  
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the &quot;web&quot; middleware group. Now create something great!
|
*/
  
Route::get('file-upload', &#x5B;FileController::class, 'index']);
Route::post('file-upload', &#x5B;FileController::class, 'store'])-&gt;name('file.store');
</pre>
<h3 class="step_code">Step 5: Create Blade File</h3>
<p>resources/views/fileUpload.blade.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;How to Upload Files to MySQL Database in Laravel 10 - codeplaners.com&lt;/title&gt;
    &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;/head&gt;
        
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
         
    &lt;div class=&quot;panel panel-primary&quot;&gt;
    
      &lt;div class=&quot;panel-heading&quot;&gt;
        &lt;h2&gt;How to Upload Files to MySQL Database in Laravel 10 - codeplaners.com&lt;/h2&gt;
      &lt;/div&gt;
    
      &lt;div class=&quot;panel-body&quot;&gt;
         
        @if ($message = Session::get('success'))
            &lt;div class=&quot;alert alert-success alert-block&quot;&gt;
                &lt;strong&gt;{{ $message }}&lt;/strong&gt;
            &lt;/div&gt;
        @endif
  
        &lt;div class=&quot;row&quot;&gt;  
            @if ($files-&gt;count())
            &lt;h3&gt;Files&lt;/h3&gt;
            &lt;table class=&quot;table table-striped table-bordered table-hover&quot;&gt;
                &lt;thead&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Name&lt;/td&gt;
                        &lt;td&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
                @foreach ($files as $file)
                &lt;tr&gt;
                    &lt;td&gt;{{ $file-&gt;name }}&lt;/td&gt;
                    &lt;td&gt;&lt;img src=&quot;data:{{ $file-&gt;mime }};base64,{{ $file-&gt;file }}&quot; style=&quot;height: 100px; width: auto&quot;&gt;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;/tbody&gt;
                @endforeach
            &lt;/table&gt;
            @endif
        &lt;/div&gt;
          
        &lt;h3&gt;Upload File:&lt;/h3&gt;
        &lt;form action=&quot;{{ route('file.store') }}&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;
            @csrf
  
            &lt;div class=&quot;mb-3&quot;&gt;
                &lt;label class=&quot;form-label&quot; for=&quot;inputFile&quot;&gt;Name:&lt;/label&gt;
                &lt;input 
                    type=&quot;text&quot; 
                    name=&quot;name&quot; 
                    id=&quot;inputFile&quot;
                    class=&quot;form-control @error('name') is-invalid @enderror&quot;&gt;
    
                @error('name')
                    &lt;span class=&quot;text-danger&quot;&gt;{{ $message }}&lt;/span&gt;
                @enderror
            &lt;/div&gt;
    
            &lt;div class=&quot;mb-3&quot;&gt;
                &lt;label class=&quot;form-label&quot; for=&quot;inputFile&quot;&gt;File:&lt;/label&gt;
                &lt;input 
                    type=&quot;file&quot; 
                    name=&quot;file&quot; 
                    id=&quot;inputFile&quot;
                    class=&quot;form-control @error('file') is-invalid @enderror&quot;&gt;
    
                @error('file')
                    &lt;span class=&quot;text-danger&quot;&gt;{{ $message }}&lt;/span&gt;
                @enderror
            &lt;/div&gt;
     
            &lt;div class=&quot;mb-3&quot;&gt;
                &lt;button type=&quot;submit&quot; class=&quot;btn btn-success&quot;&gt;Upload&lt;/button&gt;
            &lt;/div&gt;
         
        &lt;/form&gt;
        
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
      
&lt;/html&gt;
</pre>
<h3 class="step_code">Run Laravel App:</h3>
<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/how-to-upload-files-to-mysql-database-in-laravel-10/">How to Upload Files to MySQL Database in Laravel 10</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-upload-files-to-mysql-database-in-laravel-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bootstrap 5 Install in Laravel 10</title>
		<link>https://codeplaners.com/bootstrap-5-install-in-laravel-10/</link>
					<comments>https://codeplaners.com/bootstrap-5-install-in-laravel-10/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 26 Jun 2024 03:14:16 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1582</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you bootstrap 5 install in laravel 10. This article will give you simple bootstrap 5 install in laravel 10. you will bootstrap 5 install in laravel 10. In this article, we will implement a bootstrap 5 install in laravel &#8230; <a href="https://codeplaners.com/bootstrap-5-install-in-laravel-10/" class="more-link">Continue reading<span class="screen-reader-text"> "Bootstrap 5 Install in Laravel 10"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/bootstrap-5-install-in-laravel-10/">Bootstrap 5 Install in Laravel 10</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you bootstrap 5 install in laravel 10. This article will give you simple bootstrap 5 install in laravel 10. you will bootstrap 5 install in laravel 10. In this article, we will implement a bootstrap 5 install in laravel 10. </p>
<p>So, let’s follow few steps to create example of bootstrap 5 install in laravel 10.</p>
<h3 class="step_code">Laravel 10 Install</h3>
<p><strong>Follow This Command And Install Laravel</strong></p>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel blog
</pre>
<h3 class="step_code">Install Laravel UI Package</h3>
<p><strong>following command:</strong></p>
<pre class="brush: php; title: ; notranslate">
composer require laravel/ui --dev
</pre>
<h3 class="step_code">Install Bootstrap Auth Scaffolding</h3>
<p><strong>following command:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan ui bootstrap --auth 
</pre>
<h3 class="step_code">Install Bootstrap Icon</h3>
<p><strong>following command:</strong></p>
<pre class="brush: php; title: ; notranslate">
npm install bootstrap-icons --save-dev
</pre>
<p><strong>resources\sass\app.scss</strong></p>
<pre class="brush: php; title: ; notranslate">
/* Fonts */
@import url('https://fonts.bunny.net/css?family=Nunito');
/* Variables */
@import 'variables';
/* Bootstrap */
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons.css';
</pre>
<h3 class="step_code">Build CSS &#038; JS File</h3>
<p>In this step, we will build css and js file. so, let&#8217;s run following two commands:</p>
<pre class="brush: php; title: ; notranslate">
npm install
   
npm run build
</pre>
<h3 class="step_code">Use Bootstrap Class</h3>
<p><strong>resources\view\welcome.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!doctype html&gt;
&lt;html lang=&quot;{{ str_replace('_', '-', 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('app.name', 'Laravel') }}&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;'resources/sass/app.scss', 'resources/js/app.js'])
  
    &lt;style type=&quot;text/css&quot;&gt;
        i{
            font-size: 50px;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id=&quot;app&quot;&gt;
  
        &lt;main class=&quot;container&quot;&gt;
            &lt;h1&gt;Install Bootstrap 5 in Laravel 10 &lt;/h1&gt;
            &lt;div class=&quot;card&quot;&gt;
              &lt;div class=&quot;card-header&quot;&gt;
                Icons
              &lt;/div&gt;
              &lt;div class=&quot;card-body text-center&quot;&gt;
                    &lt;i class=&quot;bi bi-bag-heart-fill&quot;&gt;&lt;/i&gt;
                    &lt;i class=&quot;bi bi-app&quot;&gt;&lt;/i&gt;
                    &lt;i class=&quot;bi bi-arrow-right-square-fill&quot;&gt;&lt;/i&gt;
                    &lt;i class=&quot;bi bi-bag-check-fill&quot;&gt;&lt;/i&gt;
                    &lt;i class=&quot;bi bi-calendar-plus-fill&quot;&gt;&lt;/i&gt;
              &lt;/div&gt;
            &lt;/div&gt;
        &lt;/main&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3 class="step_code">Run Laravel App:</h3>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<p><strong>Now, Go to your web browser, type the given URL and view the app output:</strong></p>
<pre class="brush: php; title: ; notranslate">
http://localhost:8000/
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/bootstrap-5-install-in-laravel-10/">Bootstrap 5 Install in Laravel 10</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/bootstrap-5-install-in-laravel-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel 10 Telescope Install Example</title>
		<link>https://codeplaners.com/laravel-10-telescope-install-example/</link>
					<comments>https://codeplaners.com/laravel-10-telescope-install-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 16 Jun 2024 07:40:43 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1576</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:41 amHi dev, Today, i show you Laravel 10 Telescope Install Example. This article will give you simple Laravel 10 Telescope Install Example. you will Laravel 10 Telescope Install Example. In this article, we will implement a Laravel 10 Telescope Install Example. Laravel Telescope, a &#8230; <a href="https://codeplaners.com/laravel-10-telescope-install-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 10 Telescope Install Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-telescope-install-example/">Laravel 10 Telescope Install Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:41 am</p><p>Hi dev,</p>
<p>Today, i show you Laravel 10 Telescope Install Example. This article will give you simple Laravel 10 Telescope Install Example. you will Laravel 10 Telescope Install Example. In this article, we will implement a Laravel 10 Telescope Install Example. </p>
<p>Laravel Telescope, a powerful debugging tool for Laravel apps, was designed by the Laravel team. The ability to see within an application during development makes it easier for developers to troubleshoot and optimise their code. Using Telescope&#8217;s web interface, developers may keep tabs on a number of aspects of their application in real time, including requests, queries, jobs, exceptions, and logs. Additionally, it makes it possible to create original monitoring tools that can be used for every programme component.</p>
<p>So, let’s follow few steps to create example of Laravel 10 Telescope Install Example.</p>
<h3 class="step_code">Install Laravel Telescope Package</h3>
<p><strong>Install telescope for with following command:</strong></p>
<pre class="brush: php; title: ; notranslate">
composer require laravel/telescope
</pre>
<p><strong>you can also install for specific environment:</strong></p>
<pre class="brush: php; title: ; notranslate">
composer require laravel/telescope --dev	
</pre>
<h3 class="step_code">Install Telescope</h3>
<p>install telescope by using following command that will create migration files and configuration file.</p>
<pre class="brush: php; title: ; notranslate">
php artisan telescope:install
</pre>
<pre class="brush: php; title: ; notranslate">
php artisan migrate
</pre>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<pre class="brush: php; title: ; notranslate">
localhost:8000/telescope/requests
</pre>
<h3 class="step_code">What features provide by telescope?</h3>
<pre class="brush: php; title: ; notranslate">
Requests
Commands
Schedule
Jobs
Batches
Cache
Dumps
Events
Exceptions
Gates
Logs
Mail
Models
Notifications
Queries
Redis
Views
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-telescope-install-example/">Laravel 10 Telescope Install Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-10-telescope-install-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
