Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
f364f893
Commit
f364f893
authored
Feb 01, 2022
by
alissonalbuquerque
Browse files
add dados de tabelas: users, curso e campus
parent
775380b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Models/Professor.php
deleted
100644 → 0
View file @
775380b4
use Illuminate\Support\Facades\Hash;
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
Professor
extends
Model
{
use
HasFactory
;
use
SoftDeletes
;
const
TYPE_PROFESSOR
=
1
;
const
TYPE_COORDENADOR
=
2
;
protected
$table
=
'professor'
;
protected
$fillable
=
[
'type'
,
'email'
,
'password'
];
protected
$hidden
=
[
'remember_token'
,
'password'
];
protected
$dates
=
'deleted_at'
;
}
database/factories/ProfessorFactory.php
deleted
100644 → 0
View file @
775380b4
<?php
namespace
Database\Factories
;
use
Illuminate\Database\Eloquent\Factories\Factory
;
use
Illuminate\Support\Facades\Hash
;
class
ProfessorFactory
extends
Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public
function
definition
()
{
return
[
'type'
=>
1
,
'email'
=>
$this
->
faker
->
unique
()
->
emailSafe
(),
'password'
=>
Hash
::
make
(
'12345678'
),
'remember_token'
=>
Str
::
random
(
10
),
];
}
}
database/migrations/2022_01_17_142441_create_professor_table.php
deleted
100644 → 0
View file @
775380b4
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateProfessorTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'professor'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
foreignId
(
'curso_id'
);
$table
->
foreignId
(
'professor_id'
);
$table
->
tinyInteger
(
'type'
);
$table
->
string
(
'email'
)
->
unique
();
$table
->
string
(
'password'
);
$table
->
string
(
'name'
);
$table
->
string
(
'document'
);
$table
->
string
(
'matriculation'
);
$table
->
rememberToken
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'professor'
);
}
}
database/migrations/2022_01_19_200132_create_curso_table.php
deleted
100644 → 0
View file @
775380b4
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateCursoTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'curso'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
//$table->foreignId('campus_id');
$table
->
string
(
'name'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'curso'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment