Laravel Voyager – Admin panel for Laravel

Laravel Voyager is a powerful admin panel package for Laravel that allows you to create and manage admin interfaces easily. It provides features such as CRUD (Create, Read, Update, Delete) management, a media manager, and more.

Step 1: Install Laravel

First, create a new Laravel project if you don’t have one:

bash

Step 2: Set Up the Database

Configure your database settings in the .env file:

dotenv

Step 3: Install Voyager

Install Voyager via Composer:

bash

Step 4: Publish Voyager Assets

Publish Voyager’s configuration and assets:

bash

If you want to seed the database with dummy data (including user accounts), you can use:

bash

Step 5: Configure Authentication

Voyager comes with its own user management. You can create an admin user using the following command:

bash

You’ll be prompted to enter a password for the admin user.

Step 6: Access Voyager Admin Panel

Start your Laravel server:

bash

Visit http://localhost:8000/admin in your browser. Use the admin credentials you created to log in.

Step 7: Create and Manage BREAD

BREAD stands for Browse, Read, Edit, Add, and Delete. Voyager allows you to create BREAD for your database tables easily.

  1. Create a New Table: You can create a new migration for a table using:
    bash

    Define your table structure in the migration file and run:

    bash
  2. Add BREAD: In the Voyager admin panel, navigate to Tools > Database. Select your newly created table and click BREAD.
  3. Configure BREAD: You can set up the fields, validation rules, and visibility options for your BREAD. This setup allows you to customize how the CRUD interface will look and function.

Step 8: Customize Voyager

Voyager provides various ways to customize your admin panel:

  • Custom Views: You can create custom views for your BREAD by overriding Voyager’s default views.
  • Custom Routes: Add custom routes in routes/web.php if you need additional functionality outside of the BREAD.
  • Menu Management: You can manage your admin panel’s navigation menu from the Voyager admin panel.

Step 9: Using the Media Manager

Voyager includes a media manager for uploading and managing files. You can access it via Media in the admin panel. You can configure the media settings in config/voyager.php.

Step 10: User Roles and Permissions

Voyager allows you to manage user roles and permissions:

  1. Go to Tools > Roles in the admin panel.
  2. Create roles and assign permissions to each role for managing different parts of the admin panel.

Conclusion

Laravel Voyager simplifies the process of creating an admin panel with a powerful interface for managing your application’s backend. With its built-in features and customizable options, you can quickly set up a robust admin panel for your Laravel application. As you explore Voyager, consider leveraging its extensive documentation for advanced features and customization.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top