Closed chrisurf closed 3 years ago
Is there a workaround for this BTW?
Is there a workaround for this BTW?
I've not found any
I have the same issue. How does one work with Laravel authentication using Breeze/JetStream and an admin panel like Voyager?
I just tried the following:
php artisan breeze:install
php artisan voyager:install --with-dummy
And I can use both logins without a problem. Could you guys update and see if the problem still exists?
Does the sequence of installation of Breeze and Voyager matter? I installed Voyager first and then Breeze.
Don't think so. I will try later.
Edit: Installing Breeze overrides the routes. Check if routes/web.php
still includes voyagers routes.
Hi Christoph, the contents of my routes/web.php
are:
Route::get('/', function () {
return view('welcome');
});
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth'])->name('dashboard');
require __DIR__.'/auth.php';
I guess you're right. Breeze overrides the routes set in by Voyager. I'll try afresh.
That makes sense.
Simply add this to the end of routes/web.php
:
Route::group(['prefix' => 'admin'], function () {
Voyager::routes();
});
Alright! That works! I can access /admin and the other routes as expected. Thanks a ton, Christoph!!!
Sweet.
Closing as we can't do anything about it. Here's what you can do:
php artisan voyager:install
againThis issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Version information
Description
After user authentication to my domain.com/admin redirects to domain.com and not to the admin panel. Unauthorised users can see the voyager login form (domain.com/admin).
I tried the following...
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
domain.com/admin should open the voyager admin panel.
Additional context
composer.json
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.3|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.12", "laravel/tinker": "^2.5", "livewire/livewire": "^2.4", "tcg/voyager": "^1.4" }, "require-dev": { "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "laravel/breeze": "^1.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", "phpunit/phpunit": "^9.3.3" }, "autoload": { "psr-4": { "App\\": "app/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "scripts": { "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] }, "extra": { "laravel": { "dont-discover": [] } }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, "minimum-stability": "dev", "prefer-stable": true, "repositories": { "hooks": { "type": "composer", "url": "https://larapack.io" } } }
package.json
{ "private": true, "scripts": { "dev": "npm run development", "development": "mix", "watch": "mix watch", "watch-poll": "mix watch -- --watch-options-poll=1000", "hot": "mix watch --hot", "prod": "npm run production", "production": "mix --production" }, "devDependencies": { "@tailwindcss/forms": "^0.2.1", "alpinejs": "^2.7.3", "autoprefixer": "^10.1.0", "axios": "^0.21", "laravel-mix": "^6.0.6", "lodash": "^4.17.19", "postcss": "^8.2.1", "postcss-import": "^12.0.1", "tailwindcss": "^2.1.1" } }