I'm new to laravel , so my question might be weird for someone. Well, to my question, how can I write an object in the Laravel Model class, which after my transfer will not create a single field in the database. for example
class JobseekerModel extends Model { use SoftDeletes; protected $table='dbl_jobseekers'; protected $primaryKey='id'; protected $fillable=[ 'FirstName', 'MiddleName', 'LastName', 'Dob', 'Education', 'DesireField', 'Skill', 'SpecialSkill', 'Experience', 'Location', 'HomeAddress', 'Salary', 'Comenteries', 'Resume' ]; protected $dates = ['deleted_at']; }
This is my model, now I want to add another property called "PagedListSize" in my model, however I do not like to create it as a database column. So how do I do this?
For example, I am familiar with using the NotMapped property in the .Net Framework , which is written as
[NotMapped] public int PagedListSize {set; get;}
So how can I do this. Is there a way to do this in laravel? I am working on Laravel 5.4
php eloquent laravel-5 model
gdmanandamohon
source share