imTigger / laravel-job-status

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

Add table name to default model #66

Closed lucasgiovanny closed 2 years ago

lucasgiovanny commented 3 years ago

Add the table name to the default model is important because when someone wants to use a personalized model and extends the default one but using a different name, Laravel will try to solve the table name based on the name of the personalized model.

Adding the table name, avoid this automatic behaviour.

Eg.:

<?php

namespace App\Models;

use Imtigger\LaravelJobStatus\JobStatus;

class Cron extends JobStatus
{

    protected $table = "job_statuses"; // When extending JobStatus, personalized models will always need this line if the filename is not "JobStatus". With this Pull Request, not anymore.

}