InventoryDailyLog.php 605 B

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