0

I have extended the Rainlabs User plugin, to create a new table to list items created by each user, but the value stored after the save for the user_id is NULL.

Here my code :

Model Item.php

public $belongsTo = [
    'user' => ['RainLab\User\Models\User', 'key' => 'user_id'],
];

And this is what I have in my plugin.php file:

public function boot() { 
    User::extend(function($model){ 
        $model->hasOne['item'] = ['Author\Marka\Models\Item'];
    });
}

Thank your for the help...

badaoui220
  • 29
  • 1
  • 5

0 Answers0