File: /var/www/vhost/disk-apps/alq-cali.bikenow.co/app/Models/Experience/ExperienceUser.php
<?php
namespace App\Models\Experience;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class ExperienceUser extends Model
{
use SoftDeletes;
protected $dates = ['deleted_at'];
protected $fillable = [
'id',
'first_name',
'last_name',
'birthdate',
'document_type_id',
'document',
'email',
'phone',
'identification_file',
'insurance_file',
'guardian_first_name',
'guardian_last_name',
'guardian_document',
'guardian_email',
'guardian_phone',
'user_id',
'experience_type',
'dial_code',
'country_code'
];
public function user()
{
return $this->belongsTo(User::class);
}
public function experiencePayments()
{
return $this->belongsToMany(ExperiencePayment::class);
}
public function getShortNameAttribute()
{
return explode(' ', trim($this->first_name))[0] . ' ' . explode(' ', trim($this->last_name))[0];
}
}