PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Unsolved

Protecting Package Routes With Wave

derekbuntin

Oct 28th, 2018 03:19 AM

I've created a custom package with it's own routes, which work fine with no middleware.

Upon reading the documention, which seem clear enough, I can either wrap the routes in a middleware group or append the middleware to the end of the route definition.

I've tried:

Route::group(['middleware' => 'wave'], function(){ Route::get('campaigns','\Adonis\Leads\Controllers\LeadController@index')->name('campaigns'); });

and Route::get('campaigns','\Adonis\Leads\Controllers\LeadController@index')->name('campaigns')->middleware('wave');

Irrespective of which I use I'm always redirected to the dashboard, what am I doing wrong here?

derekbuntin

Oct 28th, 2018 03:40 AM

Changing the middleware to 'web' allows access to this page when logged in as I've added the auth check in the constructor.

I probably need to restrict this to the 'wave' middleware though so if the account subscription has expired the customer should not have aceess and shou;d be forwarded to the renew page to select a plan.