With Laravel 5.1 released, we’ve seen the introduction of new jobs, new purchase codes, and some great new tools to help you manage your business.
However, with all the new features, there’s always something to consider, and one thing to remember is that some jobs aren’t available with purchase codes.
That’s where Laravel’s Job class comes in.
Job class is a way to get a job at a certain level of your company, without having to pay a lot of money.
A Job class is like a product that you buy, but it doesn’t have any real functionality.
The Job class allows you to get access to a specific set of features, but also to take a break from doing business, or just to get your feet wet.
The easiest way to understand a Job class’ capabilities is to take it for a spin.
Job Class FeaturesJob class has a few core features that allow you to create, edit, and delete jobs.
The following are some of the most commonly used Job classes in Laravel.
Job class extends Laravel\Job className:string The name of the job that you want to create.
The name can be a string or an array.
The Job class also has a method that you can call when you want the job to be created.
createJob(id:string, title:string):function() The method that will be called when the job is created.
This method accepts an id that represents the job.
This is the same id that is returned when you create the job object.
If the job id is null or invalid, the job will be created empty.job:string Optional description of the Job class.
The job name is optional.
The description will be a key in the Job object.jobid:integer Optional Job class id.
The ID of the class.
This will be the same value that the job was created with.
This can be the ID of an existing job or an empty string.jobtitle:string Required title of the given Job class job.
job title is optional and can be null if not given.jobparams:string Job class params that can be used when the Job is created or edited.
The params are an array of key/value pairs, where each value will be used to specify the actions the Job should perform.jobclass:string Laravel class name.
The class name will be returned when the class is created, but is optional if not provided.
jobclass:array Job class properties.
jobname is optional, and can contain the string ‘Job’ if not specified.jobname:string string Optional job name.
jobtitle is optional but can contain either ‘Job’, ‘Create’ or ‘Edit’ if given.
jobid:number Job class ID.
This value can be an integer, a string, or null.jobTitle:string String Job title.
jobTitle:array string Job title array of job title values.jobdetails:array array Array of Job details.
jobtype:string Type of job.
The type of job is a string.
Job type can be either a string value, an array, or an object with the same type.jobparam:array Array of job parameters.jobtype:array Array of type parameters.
Job parameter values can be arrays of any of the following: ‘all’ or all ‘custom’ or custom ’email’ or email ‘code’ or code ‘company’ or company ‘phone’ or phone ‘company email’ or employeeEmail ‘company name’ or name ‘company phone’ or number ’employee’ or userNameJobparamarray Array or object of job parameter values.
The parameter values are arrays of key value pairs where each key will be an array item.
The values can have a value of ‘all’, ‘custom’, ’email’, ‘code’, or ‘company’.jobidparamarray array or object containing JobID.
JobID is an integer value, or can contain an array value.jobinfoarray Array containing JobInfo.
JobInfo is an array containing the Job ID, or array value, of the current job.jobdetailarray Array with job details.
Job details can be array items, or you can create a new array item for each job that has a jobid parameter.jobprice:number Price for the job in the jobclass.
jobprice:string Price for a job in a specific jobclass, or all jobs in a jobclass for a specific price.jobpriority:string Value of job priority in the status of the work.
If this is set to ‘all,’ then the priority of the jobs in the current status will be determined.
If it is set as ‘custom,’ then jobs in this jobclass will be prioritized based on the jobid, not the price.
The priority value can range from 0 to 100.jobstatus:string Status of the project in which the job belongs.
This may be a success