Examples of code I've written in PHP, Javascript, SCSS, etc.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

61 linhas
1.2 KiB

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Illuminate\Notifications\Notifiable;
  7. use App\Models\Order;
  8. use App\Models\Transaction;
  9. use App\Models\Ticket;
  10. use Laravel\Cashier\Billable;
  11. class User extends Authenticatable implements MustVerifyEmail
  12. {
  13. use HasFactory, Notifiable, Billable;
  14. /**
  15. * The attributes that are mass assignable.
  16. *
  17. * @var array
  18. */
  19. protected $fillable = [
  20. 'name',
  21. 'email',
  22. 'password',
  23. ];
  24. /**
  25. * The attributes that should be hidden for arrays.
  26. *
  27. * @var array
  28. */
  29. protected $hidden = [
  30. 'password',
  31. 'remember_token',
  32. ];
  33. /**
  34. * The attributes that should be cast to native types.
  35. *
  36. * @var array
  37. */
  38. protected $casts = [
  39. 'email_verified_at' => 'datetime',
  40. ];
  41. public function orders() {
  42. return $this->hasMany(Order::class);
  43. }
  44. public function transactions() {
  45. return $this->hasMany(Transaction::class);
  46. }
  47. public function tickets() {
  48. return $this->hasMany(Ticket::class);
  49. }
  50. }