I am developing web app using laravel. when a client/office create an account in my app they have the provision for adding their staffs. when they add a staff app should create a account for them under the client/office account and should assign a temporary username and password for them to log in to the app.
My Problems:
- How can i implement automatic registration of users
- how to assign temporary username and password for them I am using laravel 5.6 with homestead and php
Any help and suggestion are appreciated
thanks rufaidulk
$client->staff->create(['username' => 'temp', 'password' => 'temp']);Look at the docs: laravel.com/docs/5.6/eloquent-relationships (p.s. I think you need amany to manyrelationship, because clients can have many staff and staff can belong to many clients. If that last part is not true, it should be aone to manyrelationship.