We’re currently experiencing a high volume of inquiries and our response time could be up to 2 days. We apologize for the delay, and thank you for your patience. Our available time: 2 AM - 1 PM (Monday - Friday) (UTC+0 Timezone).

Okay
  Public Ticket #2592143
Routing
Closed

Comments

  • AlexanderWM started the conversation

    It became necessary to use the main Laravel routing file - /routes/web.php
    I want routes from it to be loaded earlier than routes from Botble CMS themes and plugins. How to do that?

  •  2,557
    Support replied

    Hi,

    You can't make routes/web.php load first.

    Routes in platform/themes/[your-theme]/routes/web.php will be loaded first.

    If you want to override the default routes, you can put your custom routes in theme routes.

    2332643923.png


  • AlexanderWM replied

    Very bad. This is a big mistake in the architecture of the application. Normal people have only one template on the site. And the ability to change themes on one site is useless. Moreover, it makes the system incompatible with normal Blade templates. A very stupid solution. 

    But what about BASE_FILTER_GROUP_PUBLIC_ROUTE ?
    What about    $this->loadRoutesFrom(__DIR__.'/.../routes/web.php');


  •  2,557
    Support replied

    Hi,

    That's the best solution we can do.

    Routes from theme always the first priority.

    BASE_FILTER_GROUP_PUBLIC_ROUTE is used to hook filters before route loaded.

    $this->loadRoutesFrom(__DIR__.'/.../routes/web.php'); is used to load route from path.

    Why do you want to load routes from routes/web.php first?

  • AlexanderWM replied

    I want to use usual blade templates, stored in resources/views/ and use

    return view('auth.register');


    instead of

    return Theme::layout('auth')->scope('auth.register', [])->render();
  •  2,557
    Support replied

    Hi,

    You can use view('path to view'); as normal Laravel application but it won't extends theme layouts.

    We're building theme like this package https://github.com/FaCuZ/laravel-theme

    So we need to use Theme::scope() to call view with theme layout.

  • AlexanderWM replied

    Ок. I just cleared theme routes file. But what to do with plugin routes? Clean up as well. 

    For example, member plugin force to use it ugly form of login for /login route. 

  • AlexanderWM replied

  •  2,557
    Support replied

    You can change routes for plugin member in /platform/plugins/member/routes/web.php

    For login form, platform/plugins/member/resources/views/auth/login.blade.php

  • AlexanderWM replied

    ok