myth-auth How not to load the default routes |
Hi everyone, I am using myth for authentication in a study application. In the file "vendor\myth\auth\src\Config\Routes.php"
PHP Code: <?php I just wanted to use the login route, however if I make changes to this file in a future change my changes would be overwritten. Any way to do this? Thank you all!
06-10-2021, 07:57 AM
(This post was last modified: 06-10-2021, 08:01 AM by rafinhaa. Edit Reason: edit ) (06-09-2021, 10:41 PM)paliz Wrote: Comment routes you dont needThat way in a future update the file will be rewritten and my changes erased (06-09-2021, 04:38 PM)ikesela Wrote: auth:publish ( -> php spark auth:publish ), edit the publish file, dont edit source, after publish, file will be copied to VIEW/Auth , for the route u need to remove namespace , since all file in main view I only published the auth config edited the $views variable to: PHP Code: public $views = [ when url access gives an exception: ![]() My route file: PHP Code: $routes->group('/', ['filter' => 'login'], function($routes){ edit I don't think I understand very well, do I need to remove the myth-auth namespace?
yes you need it
$routes->group('', ['namespace' => 'Myth\Auth\Controllers'], function ($routes) { }
Enlightenment Is Freedom
(06-11-2021, 10:17 AM)paliz Wrote: yes you need itIf I use namespace my controllers is not found PHP Code: $routes->group('/', ['namespace' => 'Myth\Auth\Controllers'], function($routes){ 404 Not Found Controller or its method was not found: \Myth\Auth\Controllers\CDR\ Dashboard :: index is there any way to do it? (06-11-2021, 07:46 PM)paliz Wrote: Put dashbord ctl in app/conttoller I tried different ways, followed your tips, but to no avail. I had to do it this way: PHP Code: $routes->group('/', ['filter' => 'login'], function($routes){
after publish, system will copy firl AuthController to controller folder. myth auth config/routes.php , remove the name space for route. it will load from main view folder : View/Auth
|
Welcome Guest, Not a member yet? Register Sign In |