I am attempting to save a related model (Access.php) from my AuthenticationController on login
AuthenticationController uses User model, relationship is User hasMany Access records so wondering what is the best way to do so?
I am used to other frameworks where I would chain the models like $this->User->Access->saveUserAccess($auth_id);
I can bypass and simply use DB::table('access')->insert([myData => xxx]); But is there a correct way? Best way?
Since we take the time to define the relationships it seems it would be best to use them accordingly.
How can I use the chaining method or similar in Laravel.
Thanks,
Dave
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community