feat: Add EstimateNew and TestModel classes with relationships to Customer and Vehicle
This commit is contained in:
30
app/Models/EstimateNew.php
Normal file
30
app/Models/EstimateNew.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class EstimateNew extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'estimates';
|
||||
|
||||
public function customer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public function vehicle(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Vehicle::class);
|
||||
}
|
||||
|
||||
public function jobCard(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(JobCard::class, 'job_card_id');
|
||||
}
|
||||
}
|
||||
19
app/Models/TestModel.php
Normal file
19
app/Models/TestModel.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class TestModel extends Model
|
||||
{
|
||||
public function customer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public function vehicle(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Vehicle::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user