bernandotorrez

Karyawan.php

Oct 21st, 2020
952
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Database\Eloquent\Model;
  7.  
  8. class Karyawan extends Model
  9. {
  10.     use HasFactory;
  11.  
  12.     // Tell to model that our primary key is employee_number
  13.     protected $primaryKey = 'employee_number';
  14.  
  15.     // Tell to model that our primary key type is a string not an int
  16.     protected $keyType = 'string';
  17.  
  18.     // Tell to model that our primary key is not auto incrementing
  19.     public $incrementing = false;
  20.  
  21.     // Tell to model that our karyawan table name is tbl_karyawan
  22.     protected $table = 'tbl_karyawan';
  23.  
  24.     // Tell to model that fillable field in tbl_karyawan is only
  25.     // 'employee_number', 'employee_name', 'gender'
  26.     protected $fillable = ['employee_number', 'employee_name', 'gender'];
  27. }
  28.  
RAW Paste Data