Hi,
installed Laravel and Waterhole fluently, but stuck on the last part.
Where exactly do I have to add this piece of code. Add the following to "a Service Provider". I know where Service Providers are but don't use them
Extend\ForumRoutes::add(function () {
Route::name('login')->get(
'login',
fn() => redirect()
->setIntendedUrl(url()->previous())
->route('login'),
);
});
When i add it to boot in the AppServiceProvider i get an error
Illuminate\Routing\Route::name() cannot be called statically
6 Comments
Hi @Kate, you should add that code to the
extend
method ofWaterholeServiceProvider
– see this page on the docs for more information.Also, the error looks like you might've imported
Illuminate\Routing\Route
instead ofIlluminate\Support\Facades\Route
?I shall make some improvements to the docs to make these things clearer!
How to add a sign up/register link to the top navigation bar like you have on this Waterhole forum?
@Kate, can you clarify which links you are talking about? (Maybe with a screenshot?)
Ah, I see - that link is a part of Waterhole by default so I wasn't sure if it was the one you were talking about. But, it only shows up if there is a route named
waterhole.register
- and if you have set theallow_registration
config tofalse
(as you should when setting up the Laravel integration), then that route won't exist.The solution is to register your own
register
route to redirect to your app's registration page, similar to what should already be doing for thelogin
route:Hey @Toby, for the Laravel Integration portion of the docs, maybe you could add a step to create a symbolic link from
public/storage
tostorage/app/public
by running the command below. Otherwise the js/css files won't load when visiting the waterhole portion of the application.I wasn't sure where to post this as I can't submit changes to the docs.