Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

usamaahmed's avatar

Using Breeze and Voyager for users and admin

Hi, I'm new to laravel, I want to use breeze for front users and voyager for backend. I installed both laravel and breeze in my project, whenever I logged in voyager it redirects to the home page of the site because it is using the same users table. Do I have to make a separate table for voyager or breeze or I can use the same table by adding 'Roles' in it. Thanks.

0 likes
2 replies
tisuchi's avatar

@usamaahmed

In your Laravel project, you can use the same users table for both Breeze and Voyager by adding a role column to the table and assigning different roles to the users.

To do this, you can follow these steps:

  • Add a role column to the users table using a migration:
Schema::table('users', function (Blueprint $table) {
    $table->string('role')->nullable();
});
  • Assign different roles to the users as needed. For example, you could assign the admin role to the users who should have access to Voyager, and the user role to the users who should have access to Breeze.

  • In your Laravel application, you can then check the user's role to determine which features they should have access to. For example, in your routes file, you could define separate routes for the admin and user roles like this:

Route::middleware('auth')->group(function () {
    Route::prefix('admin')->middleware('role:admin')->group(function () {
        // Routes for the admin role go here
    });
    
    Route::prefix('user')->middleware('role:user')->group(function () {
        // Routes for the user role go here
    });
});
1 like
usamaahmed's avatar

Thanks @tisuchi but my problem is solved by this command

php artisan db:seed --class=VoyagerDatabaseSeeder

Please or to participate in this conversation.