<?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 10 Pagination Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/laravel-10-pagination/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/laravel-10-pagination/</link>
	<description>Code Solution</description>
	<lastBuildDate>Sat, 13 May 2023 01:11:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.8</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>Laravel 10 Pagination Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/laravel-10-pagination/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Laravel 10 Pagination Example</title>
		<link>https://codeplaners.com/laravel-10-pagination-example/</link>
					<comments>https://codeplaners.com/laravel-10-pagination-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 12 May 2023 09:40:40 +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 Pagination]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1484</guid>

					<description><![CDATA[<p>Hi Dev, Are you trying to find an example of pagination with Laravel 10? It is a straightforward example of laravel 10 pagination using bootstrap 5. The idea behind the laravel 10 pagination tailwind example is clear. We&#8217;ll examine a case study demonstrating how to install pagination in Laravel 10. So, let&#8217;s examine an example &#8230; <a href="https://codeplaners.com/laravel-10-pagination-example/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 10 Pagination Example"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-pagination-example/">Laravel 10 Pagination Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi Dev,</p>
<p>Are you trying to find an example of pagination with Laravel 10? It is a straightforward example of laravel 10 pagination using bootstrap 5. The idea behind the laravel 10 pagination tailwind example is clear. We&#8217;ll examine a case study demonstrating how to install pagination in Laravel 10. So, let&#8217;s examine an example in more detail.</p>
<p>We&#8217;ll conduct the migration in this example and make a &#8220;users&#8221; table. The tinker command will then be used to produce fake records. Then we will utilise pagination to display those users. By default, Laravel uses the Tailwind CSS design for pagination; in this article, we&#8217;ll utilise the Bootstrap 5 design.</p>
<p>So let’s follow few step.</p>
<h3 class="step_code">Step 1: Install Laravel 10</h3>
<p><strong>Run command and install laravel</strong></p>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-app
</pre>
<h3 class="step_code">Step 2: Database Configuration</h3>
<p><strong>.env</strong></p>
<pre class="brush: php; title: ; notranslate">
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=here your database name
DB_USERNAME=here database username
DB_PASSWORD=here database password
</pre>
<h3 class="step_code">Step 3: Create Dummy Users</h3>
<p><strong>Let&#8217;s run migration command:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan migrate
</pre>
<p><strong>Next, run ticker command to add dummy users:</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan tinker
User::factory()-&gt;count(100)-&gt;create()
</pre>
<h3 class="step_code">Step 4: Add Route</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\UserController;
  
/*
|--------------------------------------------------------------------------
| 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('users', &#x5B;UserController::class, 'index']);
</pre>
<h3 class="step_code">Step 5: Create Controller</h3>
<p><strong>app/Http/Controllers/UserController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
  
namespace App\Http\Controllers;
  
use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\View\View;
  
class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request): View
    {
        $users = User::paginate(5);
  
        return view('users', compact('users'));
    }
}
</pre>
<h3 class="step_code">Step 6: Create Blade File</h3>
<p><strong>resources/views/users.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Laravel 10 Pagination Example - ItSolutionStuff.com&lt;/title&gt;
    &lt;link href=&quot;https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
      
&lt;div class=&quot;container&quot;&gt;
    &lt;h1&gt;Laravel 10 Pagination Example - ItSolutionStuff.com&lt;/h1&gt;
  
    &lt;table class=&quot;table table-bordered data-table&quot;&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;ID&lt;/th&gt;
                &lt;th&gt;Name&lt;/th&gt;
                &lt;th&gt;Email&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
            @forelse($users as $user)
                &lt;tr&gt;
                    &lt;td&gt;{{ $user-&gt;id }}&lt;/td&gt;
                    &lt;td&gt;{{ $user-&gt;name }}&lt;/td&gt;
                    &lt;td&gt;{{ $user-&gt;email }}&lt;/td&gt;
                &lt;/tr&gt;
            @empty
                &lt;tr&gt;
                    &lt;td colspan=&quot;3&quot;&gt;There are no users.&lt;/td&gt;
                &lt;/tr&gt;
            @endforelse
        &lt;/tbody&gt;
    &lt;/table&gt;
  
    &lt;!-- 
        You can use Tailwind CSS Pagination as like here:
        {!! $users-&gt;withQueryString()-&gt;links() !!}        
    --&gt;
  
    {!! $users-&gt;withQueryString()-&gt;links('pagination::bootstrap-5') !!}
&lt;/div&gt;
     
&lt;/body&gt;
     
&lt;/html&gt;
</pre>
<h3 class="step_code">Run Laravel App:</h3>
<p>All the required steps have been done, now you have to type the given below command and hit enter to run the Laravel app:</p>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<pre class="brush: php; title: ; notranslate">
http://localhost:8000/users
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-pagination-example/">Laravel 10 Pagination Example</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-10-pagination-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
