InventoryDailyLog.php 666 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class InventoryDailyLog extends Model
  6. {
  7. use ModelLogChanging;
  8. public $timestamps=false;
  9. protected $fillable=[
  10. 'owner_id','created_at','commodity_id','amount','volumn_occupied','gross_weight','depository_id'
  11. ];
  12. public function owner(){
  13. return $this->hasOne('App\Owner','id','owner_id')->select('id','name');
  14. }
  15. public function commodity(){
  16. return $this->hasOne('App\Commodity','id','commodity_id');
  17. }
  18. public function depository(){
  19. return $this->hasOne('App\Depository','id','depository_id');
  20. }
  21. }