✏️ Edit: DeliveryMan.php
Path:
/home/thiqat5/tmphone.thiqatech.com/tm/app/Model/DeliveryMan.php
Size: 538 B · Modified: 2021-11-17 23:00:14 · Perm: 0644 · Writable
← Back to directory
👁 View
⬇ Download
<?php namespace App\Model; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\DB; class DeliveryMan extends Authenticatable { use Notifiable; public function reviews() { return $this->hasMany(DMReview::class,'delivery_man_id'); } public function rating() { return $this->hasMany(DMReview::class) ->select(DB::raw('avg(rating) average, delivery_man_id')) ->groupBy('delivery_man_id'); } }
💾 Save
Cancel
Save as UTF-8, newlines normalized to LF