Commit d7132521 authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

alteração de models e add de novos models

parent debc5735
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Campus extends Model
{
use HasFactory;
/**
* References table campus
*
* @var string
*/
protected $table = "campus";
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'unidade'];
}
...@@ -9,10 +9,19 @@ class Curso extends Model ...@@ -9,10 +9,19 @@ class Curso extends Model
{ {
use HasFactory; use HasFactory;
/**
* References table curso
*
* @var string
*/
protected $table = 'curso'; protected $table = 'curso';
protected $fillable = ['name']; /**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'campus_id'];
} }
...@@ -12,26 +12,28 @@ class User extends Authenticatable ...@@ -12,26 +12,28 @@ class User extends Authenticatable
{ {
use HasApiTokens, HasFactory, Notifiable; use HasApiTokens, HasFactory, Notifiable;
const TYPE_MENAGER = 1;
const TYPE_TEACHER = 2;
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 2;
CONST STATUS_DELETED = 0;
protected $table = "users";
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
* @var array<int, string> * @var array<int, string>
*/ */
protected $fillable = [ protected $fillable = ['name', 'email', 'password', 'document', 'type', 'status', 'unidade', 'curso_id'];
'name',
'email',
'password',
];
/** /**
* The attributes that should be hidden for serialization. * The attributes that should be hidden for serialization.
* *
* @var array<int, string> * @var array<int, string>
*/ */
protected $hidden = [ protected $hidden = ['password', 'remember_token'];
'password',
'remember_token',
];
/** /**
* The attributes that should be cast. * The attributes that should be cast.
...@@ -39,6 +41,6 @@ class User extends Authenticatable ...@@ -39,6 +41,6 @@ class User extends Authenticatable
* @var array<string, string> * @var array<string, string>
*/ */
protected $casts = [ protected $casts = [
'email_verified_at' => 'datetime', 'email_verified_at' => 'datetime'
]; ];
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment