Viewing file: Delivery.php (1.23 KB) -rwxrwxrwx Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model;
class Delivery extends Model { use HasFactory;
protected $table="deliveries"; public $fillable = ['sale_id', 'invoice_no', 'customer_id', 'address', 'vendor_id', 'delivered_by', 'status','note']; public function statusData() { return $this->hasOne('App\Models\SaleState', 'sale_id', 'sale_id'); } public function saleData() { return $this->hasOne('App\Models\Order', 'id', 'sale_id')->select('id','order_id','total_items','grand_total','payment_status','payment_method'); // return $this->hasMany(Post::class)->select('id', 'title', 'created_at');
} public function returnData() { return $this->hasOne('App\Models\ReturnRequest', 'sale_id', 'sale_id'); } // public function vendor() // { // return $this->hasOne('App\Models\Vendor', 'id', 'vendor_id'); // } // public function shop_Data() // { // return $this->hasOne('App\Models\Shop', 'page_id', 'page_id'); // } // public function delivery_partner() // { // return $this->hasOne('App\Models\DeliveryPartner', 'id', 'delivered_by'); // } }
|