<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: anil kumar thakur</title>
    <description>The latest articles on DEV Community by anil kumar thakur (@anilkumarthakur60).</description>
    <link>https://dev.to/anilkumarthakur60</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F684919%2F78793518-7760-49db-aba5-28444eb6224d.jpeg</url>
      <title>DEV Community: anil kumar thakur</title>
      <link>https://dev.to/anilkumarthakur60</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anilkumarthakur60"/>
    <language>en</language>
    <item>
      <title>Building Better JSON Visualization in Vue 3</title>
      <dc:creator>anil kumar thakur</dc:creator>
      <pubDate>Wed, 23 Oct 2024 15:19:01 +0000</pubDate>
      <link>https://dev.to/anilkumarthakur60/building-better-json-visualization-in-vue-3-5333</link>
      <guid>https://dev.to/anilkumarthakur60/building-better-json-visualization-in-vue-3-5333</guid>
      <description>&lt;p&gt;When working with complex data structures in JavaScript applications, especially JSON objects, it's crucial to have a tool that helps visualize the data clearly. If you're building a Vue 3 application and looking for a robust way to display your JSON data, the &lt;a href="https://www.npmjs.com/package/@anilkumarthakur/vue3-json-viewer" rel="noopener noreferrer"&gt;anilkumarthakur/vue3-json-viewer&lt;/a&gt; package is an ideal solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to vue3-json-viewer
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/@anilkumarthakur/vue3-json-viewer" rel="noopener noreferrer"&gt;anilkumarthakur/vue3-json-viewer&lt;/a&gt; is a lightweight yet powerful package designed specifically for Vue 3 applications to visualize JSON data. It provides a clean, collapsible interface for working with JSON, making it easier to navigate deeply nested data structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Depending on the package manager you're using, installing the package is straightforward. Below are the commands for different package managers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# For npm
npm install @anilkumarthakur/vue3-json-viewer
# For yarn
yarn add @anilkumarthakur/vue3-json-viewer
# For bun
bun add @anilkumarthakur/vue3-json-viewer
# For pnpm
pnpm add @anilkumarthakur/vue3-json-viewer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;After installing the package, you can easily integrate the &lt;strong&gt;JsonViewer&lt;/strong&gt; component into your Vue 3 application. Below is a practical example showing how to use the package:&lt;br&gt;
Step-by-Step Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script setup lang="ts"&amp;gt;
  import { computed, ref } from 'vue';
  import { JsonViewer } from '@anilkumarthakur/vue3-json-viewer';
  import '@anilkumarthakur/vue3-json-viewer/styles.css';
  import Moment from 'moment';

  const jsonData = {
    name: 'John Doe',
    age: 30,
    isActive: true,
    isVerified: false,
    hobbies: ['reading', 'traveling', 'swimming', 'coding'],
    items: [
      { property1: 'value', property2: 'value2', property3: 'value3' },
      { property1: 'value', property2: 'value2', property3: 'value3' },
    ],
    address: {
      street: '123 Main St',
      city: 'New York',
      state: 'NY',
      zipCode: '10001',
      coordinates: { latitude: 40.7128, longitude: -74.006 },
    },
    temperature: -2.757,
    currentDate: new Date(),
    formattedDate: Moment().format('YYYY-MM-DD'),
    deepNestedObject: {
      level1: {
        level2: {
          level3: { level4: { level5: { deepKey: 'deep value' } } },
        },
      },
    },
  };

  const isDarkMode = ref(true);
  const toggleDarkMode = () =&amp;gt; {
    isDarkMode.value = !isDarkMode.value;
  };

  const isExpanded = ref(true);
  const toggleExpanded = () =&amp;gt; {
    isExpanded.value = !isExpanded.value;
  };

  const computedExpanded = computed(() =&amp;gt; {
    return isExpanded.value ? 'expanded' : 'collapsed';
  });
&amp;lt;/script&amp;gt;

&amp;lt;template&amp;gt;
  &amp;lt;button @click="toggleDarkMode"&amp;gt;Toggle Dark Mode&amp;lt;/button&amp;gt;
  &amp;lt;button @click="toggleExpanded"&amp;gt;Toggle Expanded&amp;lt;/button&amp;gt;

  &amp;lt;JsonViewer
    :data="jsonData"
    :level="0"
    :key="computedExpanded"
    :expanded="isExpanded"
    :darkMode="isDarkMode"
  /&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Toggle Dark Mode:&lt;/strong&gt; Easily switch between light and dark themes for better readability depending on the environment.&lt;br&gt;
Collapsible Data: Expand or collapse deeply nested structures, making it easier to focus on the parts of the JSON data you care about.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automatic Formatting:&lt;/strong&gt; The JSON data is displayed in a structured and formatted manner, with support for complex data types like arrays, objects, dates, and more.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to Use vue3-json-viewer&lt;/strong&gt;&lt;br&gt;
Here are some scenarios where vue3-json-viewer can be especially useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Response Debugging:&lt;/strong&gt; If you're working with APIs that return large, complex JSON responses, this tool makes it easy to explore the data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Form or Config Visualization:&lt;/strong&gt; Visualize form inputs or configurations that involve deeply nested data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Demo Purposes:&lt;/strong&gt; If you're building tool or demonstrating how different parts of an application interact with JSON, this component offers a visual aid.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/@anilkumarthakur/vue3-json-viewer" rel="noopener noreferrer"&gt;anilkumarthakur/vue3-json-viewer&lt;/a&gt; is a versatile and user-friendly tool that simplifies working with JSON data in Vue 3 applications. Whether you need to debug an API response, visualize configuration data, or display complex objects, this package provides an intuitive interface. The added flexibility of toggling dark mode and expanding/collapsing data makes it even more powerful.&lt;br&gt;
If you want to try out the package with your own data, you can also check the demo for a live example. Install vue3-json-viewer in your project today and take control of your JSON visualization experience!&lt;/p&gt;

&lt;p&gt;Demo Link:&lt;a href="https://vue3-json-viewer.vercel.app/" rel="noopener noreferrer"&gt;https://vue3-json-viewer.vercel.app/&lt;/a&gt;&lt;br&gt;
Npm Link: &lt;a href="https://www.npmjs.com/package/@anilkumarthakur/vue3-json-viewer" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@anilkumarthakur/vue3-json-viewer&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simplifying Vue Router with Vue Route Handler: A Laravel-inspired Approach</title>
      <dc:creator>anil kumar thakur</dc:creator>
      <pubDate>Sat, 13 Jan 2024 13:29:26 +0000</pubDate>
      <link>https://dev.to/anilkumarthakur60/simplifying-vue-router-with-vue-route-handler-a-laravel-inspired-approach-2bh1</link>
      <guid>https://dev.to/anilkumarthakur60/simplifying-vue-router-with-vue-route-handler-a-laravel-inspired-approach-2bh1</guid>
      <description>&lt;p&gt;Vue Route Handler is a powerful library designed to streamline the process of defining routes for Vue Router. Taking inspiration from the elegant structure of Laravel routes, this library offers a fluent and expressive syntax for constructing routes in Vue applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;To get started with Vue Route Handler, simply install the latest version using npm or yarn:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i vue-route-handler
# or
yarn add vue-route-handler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Vue Route Handler simplifies the declaration of route definitions for Vue Router by employing chained calls, reminiscent of Laravel. This allows you to easily group and nest routes as deeply as necessary.&lt;/p&gt;

&lt;p&gt;Let’s explore a basic example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createRouter, createWebHistory } from "vue-router";
import { Factory, Guard, Route } from "vue-route-handler";
import Home from "./views/Home.vue";
import About from "./views/About.vue";


Route.view({ path: "/", view: Home }).name("home");
Route.view({ path: "about", view: About }).name("about");

const router = createRouter({
  routes: Factory.routes(),
  history: createWebHistory(),
});

export default router;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code sets up a router using the Vue Route Handler, providing a clean and organized way to define routes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel-inspired Structure
&lt;/h2&gt;

&lt;p&gt;Taking inspiration from Laravel, Vue Route Handler introduces a familiar structure to Vue Router. You can group routes, apply guards, and nest routes within each other, creating a hierarchy that mirrors the organization of your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Resolver for Dynamic Imports
&lt;/h2&gt;

&lt;p&gt;Vue Route Handler supports dynamic imports using the usingResolver method and import.meta.globEager. This allows you to import views dynamically, providing a more efficient and modular approach to managing your views.&lt;/p&gt;

&lt;p&gt;Package Link :&lt;a href="https://www.npmjs.com/package/vue-route-handler"&gt;https://www.npmjs.com/package/vue-route-handler&lt;/a&gt;&lt;br&gt;
Demo Link: &lt;a href="https://vue-route-handler.vercel.app/"&gt;https://vue-route-handler.vercel.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>vuerouter</category>
      <category>laravel</category>
      <category>vuelaravel</category>
    </item>
    <item>
      <title>Laravel Advanced and fast Api Crud</title>
      <dc:creator>anil kumar thakur</dc:creator>
      <pubDate>Fri, 09 Jun 2023 13:58:53 +0000</pubDate>
      <link>https://dev.to/anilkumarthakur60/laravel-advanced-and-fast-api-crud-3oj2</link>
      <guid>https://dev.to/anilkumarthakur60/laravel-advanced-and-fast-api-crud-3oj2</guid>
      <description>&lt;p&gt;&lt;strong&gt;Fast-Api-Crud&lt;/strong&gt; is a package for Laravel that allows developers to quickly and easily create API endpoints for their CRUD (Create, Read, Update, Delete) operations. This package uses the FastAPI framework to create the API endpoints, which is known for its high performance and easy-to-use interface.&lt;/p&gt;

&lt;p&gt;One of the key benefits of using Fast-Api-Crud is the speed at which developers can create API endpoints. With just a few lines of code, developers can create a fully-functional API endpoint for any database table in their Laravel project. This means that developers can spend less time writing boilerplate code and more time building out the core features of their applications.&lt;/p&gt;

&lt;p&gt;Another benefit of using Fast-Api-Crud is the ability to customize the API endpoints to fit the needs of your project. Fast-Api-Crud includes a wide range of configuration options, allowing developers to specify the HTTP methods (GET, POST, PUT, DELETE) that are allowed for each endpoint, as well as the fields that should be included in the response.&lt;/p&gt;

&lt;p&gt;In addition to its speed and flexibility, Fast-Api-Crud is also easy to use. The package includes detailed documentation that explains how to get started with the package and how to customize the API endpoints to fit the needs of your project. Additionally, the package includes a number of helpful features, such as the automatic generation of OpenAPI documentation and support for authentication and authorization.&lt;/p&gt;

&lt;p&gt;Fast-Api-Crud is a powerful package for Laravel developers who want to quickly and easily create API endpoints for their CRUD operations. With its high performance, flexibility, and ease of use, Fast-Api-Crud is a valuable tool for any Laravel project that requires API functionality.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;index(): This method returns a collection of all records in the model's database table. It maps to the GET request on the controller's base URL. In the example given, the index method is not being explicitly mapped in the routes file, but will be mapped to the GET request on the base URL of '/posts'.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;store(): This method creates a new record in the model's database table. It maps to the POST request on the controller's base URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;show($id): This method returns a single record from the model's database table based on the ID provided in the URL. It maps to the GET request on the URL with a parameter of the record ID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;destroy($id): This method deletes a record from the model's database table based on the ID provided in the URL. It maps to the DELETE request on the URL with a parameter of the record ID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;delete(): This method is used for the bulk deletion of records. It maps to the POST request on the URL with the action of "delete".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;changeStatusOtherColumn($id,$column): This method changes the value of a specific column in the database table between 0 and 1 for a specific record based on the ID provided in the URL. It maps to the PUT request on the URL with the parameters of the record ID and the column name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;update($id): This method updates a record in the model's database table based on the ID provided in the URL. It maps to the PUT request on the URL with a parameter of the record ID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;change status ($id): This method changes the value of the "status" column in the database table between 0 and 1 for a specific record based on the ID provided in the URL. It maps to the PUT request on the URL with a parameter of the record ID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;restoreTrashed($id): This method restores a soft-deleted record in the model's database table based on the ID provided in the URL. It maps to the PUT request on the URL with a parameter of the record ID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;restoreAllTrashed(): This method restores all soft-deleted records in the model's database table. It maps to the POST request on the URL with the action of "restore-all-trashed".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;forceDeleteTrashed($id): This method hard-deletes a soft-deleted record in the model's database table based on the ID provided in the URL. It maps to the POST request on the URL with the action of "force-delete-trashed".&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The routes for these methods can be defined in the routes file for the Laravel application using the Route::controller() method, as shown in the example provided. The controller is passed as the parameter to the Route::controller() method, and the prefix of the base URL for the routes is set using the -&amp;gt;prefix() method. The routes for each method are then defined using the appropriate HTTP method and the name of the method on the controller. For example, the GET request on the base URL for the controller is mapped to the "index" method on the controller&lt;/p&gt;

&lt;p&gt;Routes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use App\Http\Controllers\PostController;
use App\Http\Controllers\TagController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

Route::middleware('auth:sanctum')-&amp;gt;get('/user', function (Request $request) {
    return $request-&amp;gt;user();
});

Route::controller(PostController::class)
    -&amp;gt;prefix('posts')
    -&amp;gt;group(callback:  function () {
        Route::get('', 'index');
        Route::post('', 'store');
        Route::post('delete', 'delete');
        Route::post('restore-all-trashed', 'restoreAllTrashed');
        Route::post('force-delete-trashed', 'forceDeleteTrashed');
        Route::get('{id}', 'show');
        Route::put('{id}', 'update');
        Route::put('{id}/status-change/{column}', 'changeStatusOtherColumn'); //specific columns change value from 0 to 1 and vice versa
        Route::put('{id}/status-change', 'changeStatus');//default status column from 0 to 1 and vice versa
        Route::put('{id}/restore-trash', 'restoreTrashed');
        Route::delete('{id}', 'destroy');
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Controller example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use Anil\FastApiCrud\Controller\CrudBaseController;
use App\Http\Requests\StoreTagRequest;
use App\Http\Requests\UpdateTagRequest;
use App\Http\Resources\Tag\TagResource;
use App\Models\Tag;
use Exception;

class TagController extends CrudBaseController
{


    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct(
            model: Tag::class,
            storeRequest: StoreTagRequest::class,
            updateRequest: UpdateTagRequest::class,
            resource: TagResource::class,
        );
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use Anil\FastApiCrud\Controller\CrudBaseController;
use App\Http\Requests\StorePostRequest;
use App\Http\Requests\UpdatePostRequest;
use App\Http\Resources\Post\PostResource;
use App\Models\Post;
use Exception;

class PostController extends CrudBaseController
{
    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct(
            model: Post::class,
            storeRequest: StorePostRequest::class,
            updateRequest: UpdatePostRequest::class,
            resource: PostResource::class,
        );


    }
    //
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use Anil\FastApiCrud\Controller\CrudBaseController;
use App\Http\Requests\StoreCategoryRequest;
use App\Http\Requests\UpdateCategoryRequest;
use App\Http\Resources\Category\CategoryResource;
use App\Models\Category;
use Exception;

class CategoryController extends CrudBaseController
{

    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct(
            model: Category::class,
            storeRequest: StoreCategoryRequest::class,
            updateRequest: UpdateCategoryRequest::class,
            resource: CategoryResource::class,
        );
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Package Link&lt;br&gt;
&lt;a href="https://dev.tourl"&gt;https://packagist.org/packages/anil/fast-api-crud&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example Link &lt;br&gt;
&lt;a href="https://dev.tourl"&gt;https://github.com/anilkumarthakur60/Fast-Api-Crud-Example&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simplifying Password Reset in Laravel with Custom Eloquent Model for Authentication</title>
      <dc:creator>anil kumar thakur</dc:creator>
      <pubDate>Fri, 02 Jun 2023 07:34:45 +0000</pubDate>
      <link>https://dev.to/anilkumarthakur60/simplifying-password-reset-in-laravel-with-custom-eloquent-model-for-authentication-9g</link>
      <guid>https://dev.to/anilkumarthakur60/simplifying-password-reset-in-laravel-with-custom-eloquent-model-for-authentication-9g</guid>
      <description>&lt;p&gt;Password reset functionality is a crucial aspect of any web application that deals with user authentication. In Laravel, the framework provides a convenient way to handle password resets out of the box. However, there are scenarios where you might want to customize the behavior and use a custom Eloquent model for authentication. In this article, we will explore a quick example that demonstrates how password reset can be implemented using a custom Eloquent model in Laravel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting up the Environment&lt;/strong&gt;&lt;br&gt;
Before diving into the implementation details, let’s make sure we have the necessary environment set up. Ensure that you have a Laravel project up and running with the required dependencies installed. If you haven’t already, create the relevant database tables and models for authentication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Code Example&lt;/strong&gt;&lt;br&gt;
Let’s take a look at the code snippet that demonstrates how password reset can be achieved using a custom Eloquent model for authentication.&lt;br&gt;
`public function passwordReset(Request $request): JsonResponse&lt;br&gt;
    {&lt;br&gt;
        try {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        $admin = Admin::whereEmail($request-&amp;gt;input('email'))-&amp;gt;firstOrFail();
        PasswordResetJob::dispatch($admin);

        return response()-&amp;gt;json(
            [
                'message' =&amp;gt; 'Password reset link sent on your email id.',
            ],
            ResponseAlias::HTTP_OK
        );
    } catch (Exception $e) {
        return response()-&amp;gt;json(
            [
                'error' =&amp;gt; $e-&amp;gt;getMessage(),
            ],
            ResponseAlias::HTTP_BAD_REQUEST
        );
    }
}`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The PasswordResetJob&lt;/strong&gt;&lt;br&gt;
Let’s now take a closer look at the PasswordResetJob class, which handles the actual password reset process.&lt;br&gt;
`&amp;lt;?php&lt;/p&gt;

&lt;p&gt;namespace App\Jobs;&lt;/p&gt;

&lt;p&gt;use App\Models\Admin;&lt;br&gt;
use Illuminate\Auth\Notifications\ResetPassword;&lt;br&gt;
use Illuminate\Bus\Queueable;&lt;br&gt;
use Illuminate\Contracts\Queue\ShouldQueue;&lt;br&gt;
use Illuminate\Foundation\Bus\Dispatchable;&lt;br&gt;
use Illuminate\Queue\InteractsWithQueue;&lt;br&gt;
use Illuminate\Queue\SerializesModels;&lt;br&gt;
use Illuminate\Support\Facades\Password;&lt;/p&gt;

&lt;p&gt;class PasswordResetJob implements ShouldQueue&lt;br&gt;
{&lt;br&gt;
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function __construct(public Admin $admin)
{
}

public function handle(): void
{
    ResetPassword::createUrlUsing(function (Admin $admin, string $token) {
        return "https://example.com/reset-password?token=$token";
    });
    $this-&amp;gt;admin-&amp;gt;sendPasswordResetNotification(
        Password::broker()-&amp;gt;createToken($this-&amp;gt;admin)
    );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;/p&gt;

&lt;p&gt;The PasswordResetJob class is responsible for generating the password reset URL and triggering the password reset notification to the admin user. In this example, we use the ResetPassword notification class provided by Laravel, which allows customization of the password reset URL creation. We set the URL using the createUrlUsing method, and then send the password reset notification to the admin user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Customizing the password reset functionality in Laravel using a custom Eloquent model for authentication provides flexibility and control over the process. In this article, we explored a simple example that demonstrated how password reset can be achieved with a custom Eloquent model. Feel free to apply this approach to your Laravel projects and customize it further based on your specific requirements.&lt;/p&gt;

&lt;p&gt;Remember, password security is a critical aspect of any application, so ensure that you follow best practices and take necessary precautions to protect user data.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;In this article, we covered the implementation details of password reset using a custom Eloquent model for authentication in Laravel. We explored a code example and discussed the concepts and steps involved. By leveraging the power of Laravel’s customization capabilities, you can adapt the password reset functionality to suit your application’s needs.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>authentication</category>
      <category>adminmode</category>
    </item>
  </channel>
</rss>
