1234567891011121314151617181920212223242526 |
- <?php
-
- namespace App\Model\Data;
-
- use Illuminate\Database\Eloquent\Model;
-
- class StockLogs extends Model
- {
- //protected $connection = 'connection-name'; //jika menggunakan 2 DB modelnya harus dikasih ini
- //protected $primaryKey = 'your_key_name'; // set primarykeymu jika bukan ID
- protected $table = 'stock_logs';
- protected $fillable = [
- 'user_id',
- 'log',
- 'quantity_kantong',
- 'is_stock_in',
- 'is_stock_out',
- ];
- //public $incrementing = false; //jika primary keynya string
- //public $timestamps = false; //matiin created_at, updated_at
-
- public function user()
- {
- return $this->belongsTo('App\User', 'user_id', 'id');
- }
- }
|