Advertisement
soden

Untitled

Nov 25th, 2022
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Models;
  4.  
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Database\Eloquent\Model;
  7.  
  8. class Role extends Model
  9. {
  10.     use HasFactory;
  11.     // untuk memproteksi field id
  12.     protected $guarded = ['id'];
  13.  
  14.     // untuk relasi one To Many
  15.     public function users()
  16.     {
  17.         return $this->hasMany(User::class);
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement