Custom guard
Custom guard
$this->app->singleton('VoyagerGuard', function () {
return 'your-custom-guard-name';
});Example - using a different model and table for Admins
<?php
Schema::create('admins', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('role_id')->unsigned()->nullable();
$table->string('name');
$table->string('email')->unique();
$table->string('avatar')->nullable()->default('users/default.png');
$table->string('password')->nullable();
$table->string('remember_token')->nullable();
$table->text('settings')->nullable()->default(null);
$table->timestamps();
$table->foreign('role_id')->references('id')->on('roles');
});Last updated