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
rolecolumn to theuserstable 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
adminrole to the users who should have access to Voyager, and theuserrole 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
adminanduserroles 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
});
});