# \[RESOLVED\] Cake 4 : model not called on save

**URL:** <https://discourse.cakephp.org/t/resolved-cake-4-model-not-called-on-save/7018>\
**Category:** Need Help\
**Created:** [December 21, 2019, 11:04pm UTC](https://discourse.cakephp.org/t/resolved-cake-4-model-not-called-on-save/7018 "2019-12-21T23:04:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xbird](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/xbird/32/1623_2.png) [@Xbird](https://discourse.cakephp.org/u/Xbird)\
**Post date:** [December 21, 2019, 11:04pm UTC](https://discourse.cakephp.org/t/resolved-cake-4-model-not-called-on-save/7018/1 "2019-12-21T23:04:26Z")

</div>

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
