| 1234567891011121314151617181920212223 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class order extends Model
- {
- use HasFactory;
- // Define the associated table name
- protected $table = 'orders';
- // Columns that are mass assignable
- protected $fillable = ['employee_id', 'total'];
- // Define the relationship with Employee
- public function employee()
- {
- return $this->belongsTo(Employee::class, 'employee_id');
- }
- }
|