You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

2 years ago
  1. <?php
  2. namespace App\Models;
  3. use App\Documents\UserDocument;
  4. use App\Models\Traits\Validatable;
  5. use App\Models\Traits\ValidationMaker;
  6. use Illuminate\Database\Eloquent\Factories\HasFactory;
  7. use Illuminate\Foundation\Auth\User as Authenticatable;
  8. use Illuminate\Validation\Rule;
  9. use Jenssegers\Mongodb\Eloquent\SoftDeletes;
  10. class ILaravel extends Authenticatable
  11. {
  12. use HasFactory, Validatable, ValidationMaker, SoftDeletes;
  13. protected $table = 'ilaravels';
  14. protected $fillable = ['user_id', 'group_id','name', 'email', 'email_verified_at', 'password'];
  15. protected $hidden = ['password', 'remember_token'];
  16. protected $casts = [
  17. 'email_verified_at' => 'datetime'
  18. ];
  19. public function policyCheckCustom(): bool
  20. {
  21. return true;
  22. }
  23. public function rules(): array
  24. {
  25. return [
  26. 'name' => 'required|string|max:255',
  27. 'user_id' => ['required'],
  28. 'email' => ['required', 'email', Rule::unique($this->getTable(), 'email')],
  29. ];
  30. }
  31. }