imTigger / laravel-job-status

Add ability to track Job progress, status and result dispatched to Queue.
MIT License
407 stars 60 forks source link

Associate jobs with user? #6

Closed andrechalom closed 6 years ago

andrechalom commented 7 years ago

Is is possible to associate dispatched jobs with the dispatching user? I would like to display to a logged in user the list of jobs he has dispatched, but not the jobs belonging to other users. I've tried adding a "user_id" column in the jobs_statuses table, but creating a job fails with Field 'user_id' doesn't have a default value...

imTigger commented 7 years ago

You have make your user_id field nullable. Then call JobStatus::find($this->statusId)->update(['user_id' => 1]) by the end of the constructor of your Job.

imTigger commented 6 years ago

You can now customize the model and initial database migration since v0.1.11