order.php 497 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class order extends Model
  6. {
  7. use HasFactory;
  8. // Define the associated table name
  9. protected $table = 'orders';
  10. // Columns that are mass assignable
  11. protected $fillable = ['employee_id', 'total'];
  12. // Define the relationship with Employee
  13. public function employee()
  14. {
  15. return $this->belongsTo(Employee::class, 'employee_id');
  16. }
  17. }