Welcome Guest, Not a member yet? Register   Sign In
SHIELD - Table name
#4

(08-02-2022, 06:10 PM)datamweb Wrote: Hi, can you explain why two Auth packages should be used simultaneously on the same site?

My suggestion

Create constant for auth tables in Config/Auth.php. For example tbl_auth

PHP Code:
...
use 
CodeIgniter\Shield\Authentication\Passwords\ValidatorInterface;
use 
CodeIgniter\Shield\Models\UserModel;

define('tbl_auth', [
    'users' => 'users',
    'identities' => 'auth_identities',
    'logins' => 'auth_logins',
    'token_logins' => 'auth_token_logins',
    'remember_tokens' => 'auth_remember_tokens',
    'groups_users' => 'auth_groups_users',
    'permissions_users' => 'auth_permissions_users',
]);

class 
Auth extends ShieldAuth
{
... 

And use it within the file project.

Ie migration
PHP Code:
..
$this->forge->createTable(tbl_auth['users']);
..
$this->forge->createTable(tbl_auth['identities']);
.. 

Models
PHP Code:
..
protected 
$table tbl_auth['users'];
..

$data $this->select(tbl_auth['users'] . '.*')
.. 
Reply


Messages In This Thread
SHIELD - Table name - by nfaiz - 06-30-2022, 07:17 PM
RE: SHIELD - Table name - by datamweb - 08-02-2022, 06:10 PM
RE: SHIELD - Table name - by nfaiz - 01-06-2023, 06:28 AM
RE: SHIELD - Table name - by nfaiz - 08-07-2022, 07:48 AM
RE: SHIELD - Table name - by superior - 01-06-2023, 07:31 AM
RE: SHIELD - Table name - by InsiteFX - 01-07-2023, 12:38 AM
RE: SHIELD - Table name - by kenjis - 01-07-2023, 01:32 AM
RE: SHIELD - Table name - by nfaiz - 01-09-2023, 09:17 PM
RE: SHIELD - Table name - by kenjis - 02-12-2023, 11:52 PM
RE: SHIELD - Table name - by nfaiz - 02-13-2023, 01:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB