:3
This commit is contained in:
25
app/Models/Employee.php
Normal file
25
app/Models/Employee.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Employee extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
// Add these fields to allow mass assignment
|
||||
protected $fillable = [
|
||||
'first_name',
|
||||
'last_name',
|
||||
'company_id',
|
||||
'email',
|
||||
'phone',
|
||||
];
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user