Welcome Guest, Not a member yet? Register   Sign In
Let's make auto routes disable
#18

(This post was last modified: 03-25-2022, 04:52 PM by kenjis.)

@ChicagoPhil Okay, Good question.

See this tutorial:
https://www.binaryboxtuts.com/php-tutori...ntication/

You will create app/Controllers/User.php.

And you will define routes:
PHP Code:
$routes->group("api", function ($routes) {
    $routes->post("register""Register::index");
    $routes->post("login""Login::index");
    $routes->get("users""User::index", ['filter' => 'authFilter']);
}); 

If you will navigate to http://example.com/api/users (defined route), the authFilter will be applied.
But if you will navigate to http://example.com/user/index (auto route), the filter will not be applied.
Reply


Messages In This Thread
Let's make auto routes disable - by kenjis - 02-21-2022, 07:45 PM
RE: Let's make auto routes disable - by iRedds - 02-21-2022, 09:54 PM
RE: Let's make auto routes disable - by kenjis - 02-21-2022, 10:42 PM
RE: Let's make auto routes disable - by InsiteFX - 02-22-2022, 02:06 AM
RE: Let's make auto routes disable - by iRedds - 02-22-2022, 02:11 AM
RE: Let's make auto routes disable - by luckmoshy - 02-22-2022, 05:26 AM
RE: Let's make auto routes disable - by kilishan - 02-22-2022, 07:25 AM
RE: Let's make auto routes disable - by kenjis - 02-22-2022, 04:25 PM
RE: Let's make auto routes disable - by kilishan - 02-22-2022, 09:43 PM
RE: Let's make auto routes disable - by seunex - 02-22-2022, 11:26 PM
RE: Let's make auto routes disable - by kenjis - 02-26-2022, 03:04 AM
RE: Let's make auto routes disable - by luckmoshy - 02-26-2022, 03:36 AM
RE: Let's make auto routes disable - by kenjis - 03-01-2022, 06:02 PM
RE: Let's make auto routes disable - by InsiteFX - 03-02-2022, 01:41 AM
RE: Let's make auto routes disable - by kenjis - 03-25-2022, 04:15 AM
RE: Let's make auto routes disable - by sneakyimp - 02-08-2023, 06:50 PM
RE: Let's make auto routes disable - by kenjis - 03-25-2022, 04:44 PM
RE: Let's make auto routes disable - by kenjis - 03-25-2022, 09:10 PM
RE: Let's make auto routes disable - by kenjis - 03-26-2022, 02:52 AM
RE: Let's make auto routes disable - by kenjis - 03-30-2022, 07:20 PM
RE: Let's make auto routes disable - by kenjis - 02-08-2023, 06:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB