Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue that causes routes grouped with prefix to generate 404. #59

Merged
merged 2 commits into from
Oct 9, 2021

Conversation

AbdullahFaqeir
Copy link
Contributor

##Issue Reference
#50

##Description
When multilingual route(s) is/are defined in a prefixed group, the routes generates 404 pages.

How To Test This?

<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix' => 'blog'], function () {
    $c = App\Http\Controllers\BlogController::class;

    Route::multilingual('/', [$c, 'index'])->name('blog.index');
    Route::multilingual('/create', [$c, 'create'])->name('blog.create');
    Route::multilingual('/edit/{post}', [$c, 'edit'])->name('blog.edit');
    Route::multilingual('/show/{post}', [$c, 'show'])->name('blog.show');
});

Then navigate to /blog

##Extra Details
Only the root route "/" generates 404, whilst other routes with extra uri parts works just fine.

##Documentation

  • Fixed when registering a multilingual routes grouped in a prefix.
  • Added test cases to test if it can register grouped routes with a prefix and if the routes exists.

- Added test cases to test if it can register grouped routes with a prefix and if the routes exists.
@AbdullahFaqeir
Copy link
Contributor Author

Hi @chinleung!

Can you please check and review the PR?

@chinleung chinleung merged commit 843382f into chinleung:v2 Oct 9, 2021
@chinleung
Copy link
Owner

Thanks @AbdullahFaqeir!

@AbdullahFaqeir
Copy link
Contributor Author

@chinleung You're most welcome, and I'm more than happy to help anytime in the future, just ping.

@AbdullahFaqeir
Copy link
Contributor Author

Hey @chinleung!

Can you please add 'hacktoberfest' to the repo's topics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants