Browse Source

update models

master
Gunawan19621 1 year ago
parent
commit
3c5ef853e7
  1. 11
      app/Models/BarangKeluar.php
  2. 13
      app/Models/BarangMasuk.php
  3. 19
      app/Models/User.php
  4. 18
      app/Models/m_asset.php
  5. 9
      app/Models/m_role.php
  6. 10
      app/Models/m_warehouse.php

11
app/Models/BarangKeluar.php

@ -8,7 +8,16 @@ use Illuminate\Database\Eloquent\Model;
class BarangKeluar extends Model class BarangKeluar extends Model
{ {
use HasFactory; use HasFactory;
protected $table = 'barang_keluars', $guarded = ['id']; protected $table = 'barang_keluars';
protected $fillable = [
'asset_id',
'jumlah',
'tanggal_keluar',
'penerima_barang',
'exit_warehouse',
'keterangan',
];
public function asset() public function asset()
{ {

13
app/Models/BarangMasuk.php

@ -8,5 +8,16 @@ use Illuminate\Database\Eloquent\Model;
class BarangMasuk extends Model class BarangMasuk extends Model
{ {
use HasFactory; use HasFactory;
protected $table = 'barang_masuks', $guarded = ['id']; protected $table = 'barang_masuks';
protected $fillable = [
'asset_id',
'jumlah',
'tanggal_masuk',
'asal_barang',
'pengiriman_barang',
'penerima_barang',
'enter_warehouse',
'keterangan',
];
} }

19
app/Models/User.php

@ -18,7 +18,24 @@ class User extends Authenticatable implements JWTSubject
* *
* @var array<int, string> * @var array<int, string>
*/ */
protected $guarded = ['id']; protected $fillable = [
'username',
'fullname',
'nip',
'email',
'no_hp',
'divisi',
'tgl_lahir',
'jenis_kelamin',
'agama',
'foto',
'role_id',
'warehouse_id',
'address',
'password',
'created_by',
'updated_by',
];
public function warehouse() public function warehouse()
{ {

18
app/Models/m_asset.php

@ -2,13 +2,25 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class m_asset extends Model class m_asset extends Model
{ {
use HasFactory; use HasFactory, SoftDeletes;
protected $table = 'm_assets', $guarded = ['id']; protected $table = 'm_assets';
protected $fillable = [
'seri',
'name',
'description',
'warehouse_id',
'date',
'qr_count',
'created_by',
'updated_by',
];
public function warehouse() public function warehouse()
{ {

9
app/Models/m_role.php

@ -8,5 +8,12 @@ use Illuminate\Database\Eloquent\Model;
class m_role extends Model class m_role extends Model
{ {
use HasFactory; use HasFactory;
protected $table = 'm_roles', $guarded = ['id']; protected $table = 'm_roles';
protected $fillable = [
'name',
'description',
'created_by',
'updated_by',
];
} }

10
app/Models/m_warehouse.php

@ -8,5 +8,13 @@ use Illuminate\Database\Eloquent\Model;
class m_warehouse extends Model class m_warehouse extends Model
{ {
use HasFactory; use HasFactory;
protected $table = 'm_warehouses', $guarded = ['id']; protected $table = 'm_warehouses';
protected $fillable = [
'name',
'description',
'address',
'created_by',
'updated_by',
];
} }

Loading…
Cancel
Save