edit : I solved my issue
on my controller, i use this to get my Model :
$UsersTable = TableRegistry::getTableLocator()->get(‘users’);
With the ‘U’ of users set to uppercase, it’s now working like a charm.
on my dev computer, I have windows, and I use ubuntu for windows for terminal things, but look like he don’t care about case.
Hi here !
i have a strange thing happening :
with the cakephp dev webserver (bin/cake server -p 8080) my app work fine
but on my webserver, it’s look like the the UsersTable.php is not called when I create an user.
actually, my UsersTable.php look like this : (I have set some die inside to check if the file is used, but nothing happen)
<?php
declare(strict_types=1);
namespace App\Model\Table;
die('potato');
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
use Cake\Datasource\EntityInterface;
use Cake\Event\Event;
use ArrayObject;
...
use Cake\Mailer\MailerAwareTrait;
...
public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $options)
{
die('POTATO');
...
But the register script work, my user is inserted into the table, but without any of the modification i set into the beforeSave and the ‘created’ & ‘modified’ fields are wrong (set to 0000-00-00…)
this UsersTable.php file was created with the ./bin cake bake model command
on my dev computer I use php PHP 7.2.24, on server it’s 7.3.13, and I even try with 7.2.26
I have no idea what’s going on
thanks