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
e119449a
"storage/framework/git@sites.upe.br:walter.felipe/pad-upe.git" did not exist on "9ddd48ada9c6828d003580542c3a1650a773610e"
Commit
e119449a
authored
May 22, 2022
by
Abraão Barbosa
Browse files
commit to merge with main branch
parent
9823e9cb
Changes
70
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/CampusController.php
View file @
e119449a
...
@@ -7,6 +7,8 @@ use App\Models\Unidade;
...
@@ -7,6 +7,8 @@ use App\Models\Unidade;
use
App\Queries\CampusQuery
;
use
App\Queries\CampusQuery
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
use
Illuminate\Log\Logger
;
class
CampusController
extends
Controller
class
CampusController
extends
Controller
{
{
...
@@ -46,9 +48,15 @@ class CampusController extends Controller
...
@@ -46,9 +48,15 @@ class CampusController extends Controller
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
$model
=
new
Campus
();
$model
=
new
Campus
();
$model
->
name
=
$request
->
name
;
$validator
=
Campus
::
validator
(
$request
->
all
());
$model
->
unidade_id
=
$request
->
unidade_id
;
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
())
->
withInput
();
}
$model
->
fill
(
$request
->
all
());
$model
->
save
();
$model
->
save
();
return
redirect
()
->
route
(
'campus_index'
)
->
with
(
'success'
,
'Salvo com sucesso!'
);
}
}
/**
/**
...
@@ -70,7 +78,12 @@ class CampusController extends Controller
...
@@ -70,7 +78,12 @@ class CampusController extends Controller
*/
*/
public
function
edit
(
$id
)
public
function
edit
(
$id
)
{
{
//
$campus
=
Campus
::
findOrFail
(
$id
);
return
view
(
'campus.update'
,
[
'unidades'
=>
Unidade
::
all
(),
'index_menu'
=>
MenuItemsAdmin
::
CAMPUS
,
'campus'
=>
$campus
,
]);
}
}
/**
/**
...
@@ -82,7 +95,16 @@ class CampusController extends Controller
...
@@ -82,7 +95,16 @@ class CampusController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
//
$model
=
Campus
::
findOrFail
(
$id
);
$validator
=
Campus
::
validator
(
$request
->
all
());
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
());
}
$model
->
fill
(
$request
->
all
());
$model
->
save
();
return
redirect
()
->
route
(
'campus_index'
)
->
with
(
'success'
,
'Atualizado com sucesso!'
);
}
}
/**
/**
...
@@ -93,10 +115,11 @@ class CampusController extends Controller
...
@@ -93,10 +115,11 @@ class CampusController extends Controller
*/
*/
public
function
destroy
(
$id
)
public
function
destroy
(
$id
)
{
{
//
$model
=
Campus
::
find
(
$id
);
$model
->
delete
();
return
redirect
()
->
route
(
'campus_index'
)
->
with
(
'success'
,
'Excluído com sucesso!'
);
}
}
public
function
findByUnidade
(
int
$unidade_id
)
public
function
findByUnidade
(
int
$unidade_id
)
{
{
return
CampusQuery
::
whereUnidadeId
(
$unidade_id
)
->
orderBy
(
'name'
)
->
get
();
return
CampusQuery
::
whereUnidadeId
(
$unidade_id
)
->
orderBy
(
'name'
)
->
get
();
...
...
app/Http/Controllers/CoordenadorController.php
0 → 100644
View file @
e119449a
<?php
namespace
App\Http\Controllers
;
use
App\Models\User
;
use
App\Models\Util\MenuItemsAdmin
;
use
Illuminate\Http\Request
;
class
CoordenadorController
extends
Controller
{
public
function
index
()
{
$coordenadores
=
User
::
where
(
'type'
,
'='
,
User
::
TYPE_COORDINATOR
)
->
get
();
return
view
(
'coordenador.index'
,
[
'index_menu'
=>
MenuItemsAdmin
::
COORDENADORES
,
'coordenadores'
=>
$coordenadores
]);
}
/**
* @param Request $request
* @param mixed $id
*
* @return Response
*/
public
function
create
()
{
return
view
(
'coordenador.create'
,
[
'index_menu'
=>
MenuItemsAdmin
::
COORDENADORES
,
]);
}
/**
* Update the specified user.
*
* @param Request $request
* @param string $id
* @return Response
*/
public
function
update
(
Request
$request
,
$id
)
{
//
}
}
app/Http/Controllers/CursoController.php
View file @
e119449a
...
@@ -37,7 +37,12 @@ class CursoController extends Controller
...
@@ -37,7 +37,12 @@ class CursoController extends Controller
*/
*/
public
function
create
()
public
function
create
()
{
{
return
view
(
'curso.create'
);
$allCampus
=
Campus
::
all
();
return
view
(
'curso.create'
,
[
'allCampus'
=>
$allCampus
,
'index_menu'
=>
MenuItemsAdmin
::
CURSOS
]);
}
}
/**
/**
...
@@ -48,7 +53,16 @@ class CursoController extends Controller
...
@@ -48,7 +53,16 @@ class CursoController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
dd
(
$request
->
all
());
$model
=
new
Curso
();
$validator
=
Curso
::
validator
(
$request
->
all
());
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
())
->
withInput
();
}
$model
->
fill
(
$request
->
all
());
$model
->
save
();
return
redirect
()
->
route
(
'curso_index'
)
->
with
(
'success'
,
'Salvo com sucesso!'
);
}
}
/**
/**
...
@@ -70,7 +84,12 @@ class CursoController extends Controller
...
@@ -70,7 +84,12 @@ class CursoController extends Controller
*/
*/
public
function
edit
(
$id
)
public
function
edit
(
$id
)
{
{
//
$curso
=
Curso
::
findOrFail
(
$id
);
return
view
(
'curso.update'
,
[
'allCampus'
=>
Campus
::
all
(),
'index_menu'
=>
MenuItemsAdmin
::
CAMPUS
,
'curso'
=>
$curso
,
]);
}
}
/**
/**
...
@@ -82,7 +101,16 @@ class CursoController extends Controller
...
@@ -82,7 +101,16 @@ class CursoController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
//
$model
=
Curso
::
findOrFail
(
$id
);
$validator
=
Curso
::
validator
(
$request
->
all
());
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
());
}
$model
->
fill
(
$request
->
all
());
$model
->
save
();
return
redirect
()
->
route
(
'curso_index'
)
->
with
(
'success'
,
'Atualizado com sucesso!'
);
}
}
/**
/**
...
@@ -93,6 +121,8 @@ class CursoController extends Controller
...
@@ -93,6 +121,8 @@ class CursoController extends Controller
*/
*/
public
function
destroy
(
$id
)
public
function
destroy
(
$id
)
{
{
//
$model
=
Curso
::
find
(
$id
);
$model
->
delete
();
return
redirect
()
->
route
(
'curso_index'
)
->
with
(
'success'
,
'Excluído com sucesso!'
);
}
}
}
}
app/Http/Controllers/DiretorController.php
0 → 100644
View file @
e119449a
<?php
namespace
App\Http\Controllers
;
use
App\Models\Unidade
;
use
App\Models\User
;
use
App\Models\Util\MenuItemsAdmin
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Hash
;
class
DiretorController
extends
Controller
{
/**
* @return Response
*/
public
function
index
()
{
$diretores
=
User
::
where
(
'type'
,
'='
,
User
::
TYPE_MANAGER
)
->
get
();
return
view
(
'diretor.index'
,
[
'index_menu'
=>
MenuItemsAdmin
::
DIRETORES
,
'diretores'
=>
$diretores
]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public
function
create
()
{
return
view
(
'diretor.create'
,
[
'index_menu'
=>
MenuItemsAdmin
::
DIRETORES
,
'unidades'
=>
Unidade
::
all
()
]);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
store
(
Request
$request
)
{
$model
=
new
User
();
$validator
=
User
::
validator
(
$request
->
all
());
$validator
->
type
=
User
::
TYPE_MANAGER
;
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
())
->
withInput
();
}
$model
->
fill
(
$request
->
all
());
$model
->
type
=
User
::
TYPE_MANAGER
;
$model
->
password
=
Hash
::
make
(
$model
->
password
);
$model
->
save
();
return
redirect
()
->
route
(
'diretor_index'
)
->
with
(
'success'
,
'Salvo com sucesso!'
);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
show
(
$id
)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
edit
(
$id
)
{
$user
=
User
::
findOrFail
(
$id
);
return
view
(
'diretor.update'
,
[
'index_menu'
=>
MenuItemsAdmin
::
DIRETORES
,
'unidades'
=>
Unidade
::
all
(),
'user'
=>
$user
,
]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
update
(
Request
$request
,
$id
)
{
$model
=
User
::
findOrFail
(
$id
);
$validator
=
User
::
validator
(
$request
->
all
());
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
());
}
$model
->
fill
(
$request
->
all
());
$model
->
save
();
return
redirect
()
->
route
(
'diretor_index'
)
->
with
(
'success'
,
'Atualizado com sucesso!'
);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
$id
)
{
$model
=
User
::
find
(
$id
);
$model
->
delete
();
return
redirect
()
->
route
(
'diretor_index'
)
->
with
(
'success'
,
'Excluído com sucesso!'
);
}
}
app/Http/Controllers/UnidadeController.php
View file @
e119449a
...
@@ -29,7 +29,10 @@ class UnidadeController extends Controller
...
@@ -29,7 +29,10 @@ class UnidadeController extends Controller
*/
*/
public
function
create
()
public
function
create
()
{
{
return
view
(
'unidade.create'
);
return
view
(
'unidade.create'
,
[
'unidades'
=>
Unidade
::
all
(),
'index_menu'
=>
MenuItemsAdmin
::
UNIDADES
]);
}
}
/**
/**
...
@@ -40,9 +43,16 @@ class UnidadeController extends Controller
...
@@ -40,9 +43,16 @@ class UnidadeController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
$model
=
new
Unidade
();
$validator
=
Unidade
::
validator
(
$request
->
all
());
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
())
->
withInput
();
}
return
redirect
(
'/dashboard'
);
$model
->
fill
(
$request
->
all
());
$model
->
save
();
return
redirect
()
->
route
(
'unidade_index'
)
->
with
(
'success'
,
'Salvo com sucesso!'
);
}
}
/**
/**
...
@@ -65,7 +75,10 @@ class UnidadeController extends Controller
...
@@ -65,7 +75,10 @@ class UnidadeController extends Controller
public
function
edit
(
$id
)
public
function
edit
(
$id
)
{
{
$model
=
Unidade
::
find
(
$id
);
$model
=
Unidade
::
find
(
$id
);
return
view
(
'unidade.update'
,
[
'unidade'
=>
$model
]);
return
view
(
'unidade.update'
,
[
'unidade'
=>
$model
,
'index_menu'
=>
MenuItemsAdmin
::
UNIDADES
]);
}
}
/**
/**
...
@@ -77,11 +90,16 @@ class UnidadeController extends Controller
...
@@ -77,11 +90,16 @@ class UnidadeController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$model
=
Unidade
::
find
(
$id
);
$model
=
Unidade
::
findOrFail
(
$id
);
$model
->
name
=
$request
->
name
;
$validator
=
Unidade
::
validator
(
$request
->
all
());
$model
->
save
();
if
(
$validator
->
fails
())
{
return
redirect
()
->
back
()
->
withErrors
(
$validator
->
errors
());
}
return
redirect
(
'/unidade/index'
);
$model
->
fill
(
$request
->
all
());
$model
->
save
();
return
redirect
()
->
route
(
'unidade_index'
)
->
with
(
'success'
,
'Atualizado com sucesso!'
);
}
}
/**
/**
...
@@ -94,9 +112,7 @@ class UnidadeController extends Controller
...
@@ -94,9 +112,7 @@ class UnidadeController extends Controller
{
{
$model
=
Unidade
::
find
(
$id
);
$model
=
Unidade
::
find
(
$id
);
$model
->
delete
();
$model
->
delete
();
return
redirect
()
->
route
(
'unidade_index'
)
->
with
(
'success'
,
'Excluído com sucesso!'
);
return
redirect
(
'/unidade/index'
);
}
}
/**
/**
...
...
app/Models/Campus.php
View file @
e119449a
...
@@ -4,12 +4,14 @@ namespace App\Models;
...
@@ -4,12 +4,14 @@ namespace App\Models;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Validation\ValidationException
;
use
Illuminate\Validation\ValidationException
;
class
Campus
extends
Model
class
Campus
extends
Model
{
{
use
HasFactory
;
use
HasFactory
;
use
SoftDeletes
;
/**
/**
* References table campus
* References table campus
...
@@ -46,15 +48,19 @@ class Campus extends Model
...
@@ -46,15 +48,19 @@ class Campus extends Model
public
static
function
validator
(
$attributes
,
$rule_password
=
false
)
{
public
static
function
validator
(
$attributes
,
$rule_password
=
false
)
{
$rules
=
[
$rules
=
[
'name'
=>
[
'required'
,
]
'name'
=>
[
'min:8'
,
'max:255'
],
'unidade_id'
=>
[
'required'
]
];
];
$messages
=
[
$messages
=
[
// 'unique' => "O :attribute já está registrado no sistema",
// 'unique' => "O :attribute já está registrado no sistema",
'required'
=>
"O :attribute precisa ser preenchido"
,
'name.min'
=>
"O campo não tem o mínimo de caracteres permitido"
,
'name.max'
=>
"O campo atingiu o máximo de caracteres permitido"
,
'required'
=>
"O campo precisa ser preenchido"
,
];
];
try
{
try
{
//return $request->validate()
return
Validator
::
make
(
$attributes
,
$rules
,
$messages
);
return
Validator
::
make
(
$attributes
,
$rules
,
$messages
);
}
catch
(
ValidationException
$exception
)
{
}
catch
(
ValidationException
$exception
)
{
...
...
app/Models/Curso.php
View file @
e119449a
...
@@ -4,10 +4,14 @@ namespace App\Models;
...
@@ -4,10 +4,14 @@ namespace App\Models;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Validation\ValidationException
;
class
Curso
extends
Model
class
Curso
extends
Model
{
{
use
HasFactory
;
use
HasFactory
;
use
SoftDeletes
;
/**
/**
* References table curso
* References table curso
...
@@ -33,6 +37,26 @@ class Curso extends Model
...
@@ -33,6 +37,26 @@ class Curso extends Model
return
$this
->
belongsTo
(
Campus
::
class
);
return
$this
->
belongsTo
(
Campus
::
class
);
}
}
public
static
function
validator
(
$attributes
,
$rule_password
=
false
)
{
$rules
=
[
'name'
=>
[
'min:8'
,
'max:255'
],
'campus_id'
=>
[
'required'
]
];
$messages
=
[
'min'
=>
"O campo não tem o mínimo de caracteres permitido"
,
'max'
=>
"O campo atingiu o máximo de caracteres permitido"
,
'required'
=>
"O campo precisa ser preenchido"
,
];
try
{
return
Validator
::
make
(
$attributes
,
$rules
,
$messages
);
}
catch
(
ValidationException
$exception
)
{
}
}
/**
/**
* @return string
* @return string
*/
*/
...
@@ -40,6 +64,4 @@ class Curso extends Model
...
@@ -40,6 +64,4 @@ class Curso extends Model
{
{
return
$this
->
name
;
return
$this
->
name
;
}
}
}
}
app/Models/Unidade.php
View file @
e119449a
...
@@ -3,10 +3,13 @@
...
@@ -3,10 +3,13 @@
namespace
App\Models
;
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Validation\ValidationException
;
class
Unidade
extends
Model
class
Unidade
extends
Model
{
{
use
SoftDeletes
;
/**
/**
* References table unidade
* References table unidade
*
*
...
@@ -14,7 +17,6 @@ class Unidade extends Model
...
@@ -14,7 +17,6 @@ class Unidade extends Model
*/
*/
protected
$table
=
"unidade"
;
protected
$table
=
"unidade"
;
/**
/**
* The attributes that are mass assignable.
* The attributes that are mass assignable.
*
*
...
@@ -64,4 +66,24 @@ class Unidade extends Model
...
@@ -64,4 +66,24 @@ class Unidade extends Model
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
}
}
public
static
function
validator
(
$attributes
,
$rule_password
=
false
)
{
$rules
=
[
'name'
=>
[
'min:8'
,
'max:255'
],
];
$messages
=
[
// 'unique' => "O :attribute já está registrado no sistema",
'name.min'
=>
"O campo não tem o mínimo de caracteres permitido"
,
'name.max'
=>
"O campo atingiu o máximo de caracteres permitido"
,
];
try
{
//return $request->validate()
return
Validator
::
make
(
$attributes
,
$rules
,
$messages
);
}
catch
(
ValidationException
$exception
)
{
}
}
}
}
app/Models/User.php
View file @
e119449a
...
@@ -21,7 +21,7 @@ class User extends Authenticatable
...
@@ -21,7 +21,7 @@ class User extends Authenticatable
const
STATUS_ACTIVE
=
1
;
const
STATUS_ACTIVE
=
1
;
const
STATUS_INACTIVE
=
2
;
const
STATUS_INACTIVE
=
2
;
CONST
STATUS_DELETED
=
0
;
const
STATUS_DELETED
=
0
;
protected
$table
=
"users"
;
protected
$table
=
"users"
;
...
...
app/Models/Util/MenuItemsAdmin.php
View file @
e119449a
...
@@ -10,5 +10,5 @@ class MenuItemsAdmin
...
@@ -10,5 +10,5 @@ class MenuItemsAdmin
const
CURSOS
=
2
;
const
CURSOS
=
2
;
const
UNIDADES
=
3
;
const
UNIDADES
=
3
;
const
DIRETORES
=
4
;
const
DIRETORES
=
4
;
const
CORDENADORES
=
5
;
const
CO
O
RDENADORES
=
5
;
}
}
database/migrations/2014_10_12_000000_create_users_table.php
View file @
e119449a
...
@@ -26,6 +26,7 @@ class CreateUsersTable extends Migration
...
@@ -26,6 +26,7 @@ class CreateUsersTable extends Migration
$table
->
foreignId
(
'unidade_id'
)
->
nullable
();
$table
->
foreignId
(
'unidade_id'
)
->
nullable
();
$table
->
rememberToken
();
$table
->
rememberToken
();
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_02_02_014208_create_campus_table.php
View file @
e119449a
...
@@ -18,6 +18,7 @@ class CreateCampusTable extends Migration
...
@@ -18,6 +18,7 @@ class CreateCampusTable extends Migration
$table
->
string
(
'name'
);
$table
->
string
(
'name'
);
$table
->
foreignId
(
'unidade_id'
);
$table
->
foreignId
(
'unidade_id'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_02_02_014310_create_curso_table.php
View file @
e119449a
...
@@ -18,6 +18,7 @@ class CreateCursoTable extends Migration
...
@@ -18,6 +18,7 @@ class CreateCursoTable extends Migration
$table
->
string
(
'name'
);
$table
->
string
(
'name'
);
$table
->
foreignId
(
'campus_id'
);
$table
->
foreignId
(
'campus_id'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_02_09_182043_create_unidade_table.php
View file @
e119449a
...
@@ -17,6 +17,7 @@ class CreateUnidadeTable extends Migration
...
@@ -17,6 +17,7 @@ class CreateUnidadeTable extends Migration
$table
->
id
();
$table
->
id
();
$table
->
string
(
'name'
);
$table
->
string
(
'name'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_03_20_233337_create_p_a_d_s_table.php
View file @
e119449a
...
@@ -15,19 +15,21 @@ class CreatePADSTable extends Migration
...
@@ -15,19 +15,21 @@ class CreatePADSTable extends Migration
{
{
Schema
::
create
(
'pads'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'pads'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
id
();
//
$table->integer('ano')->default(false);
$table
->
integer
(
'ano'
)
->
default
(
false
);
//
$table->integer('semestre')->default(false);
$table
->
integer
(
'semestre'
)
->
default
(
false
);
//
$table->integer('carga_horaria')->default(false);
$table
->
integer
(
'carga_horaria'
)
->
default
(
false
);
//
$table->string('categoria', 20)->default(false);
$table
->
string
(
'categoria'
,
20
)
->
default
(
false
);
//
$table->boolean('afastamento_total')->default(false);
$table
->
boolean
(
'afastamento_total'
)
->
default
(
false
);
//
$table->boolean('afastamento_parcial')->default(false);
$table
->
boolean
(
'afastamento_parcial'
)
->
default
(
false
);
//
$table->boolean('exerce_funcao_admin')->default(false);
$table
->
boolean
(
'exerce_funcao_admin'
)
->
default
(
false
);
//
$table->boolean('exerce_funcao_sindical')->default(false);
$table
->
boolean
(
'exerce_funcao_sindical'
)
->
default
(
false
);
//
$table->string('licenca_de_acor_legais', 50)->default(null);
$table
->
string
(
'licenca_de_acor_legais'
,
50
)
->
default
(
null
);
//
$table->string('outras_observacoes', 200)->nullable(true);
$table
->
string
(
'outras_observacoes'
,
200
)
->
nullable
(
true
);
$table
->
foreignId
(
'user_id'
);
$table
->
foreignId
(
'user_id'
);
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_03_20_233345_create_ref_planejamento_ches_table.php
View file @
e119449a
...
@@ -23,6 +23,8 @@ class CreateRefPlanejamentoChesTable extends Migration
...
@@ -23,6 +23,8 @@ class CreateRefPlanejamentoChesTable extends Migration
->
constrained
()
->
constrained
()
->
onUpdate
(
'cascade'
)
->
onUpdate
(
'cascade'
)
->
onDelete
(
'cascade'
);
->
onDelete
(
'cascade'
);
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_03_22_113324_create_planejamentos_table.php
View file @
e119449a
...
@@ -21,6 +21,7 @@ class CreatePlanejamentosTable extends Migration
...
@@ -21,6 +21,7 @@ class CreatePlanejamentosTable extends Migration
$table
->
integer
(
'ch_semanal'
)
->
nullable
();
$table
->
integer
(
'ch_semanal'
)
->
nullable
();
$table
->
integer
(
'ch_maxima'
)
->
nullable
();
$table
->
integer
(
'ch_maxima'
)
->
nullable
();
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_03_22_225548_create_ensino_aulas_table.php
View file @
e119449a
...
@@ -24,6 +24,7 @@ class CreateEnsinoAulasTable extends Migration
...
@@ -24,6 +24,7 @@ class CreateEnsinoAulasTable extends Migration
$table
->
integer
(
'ch_total'
)
->
notNull
();
$table
->
integer
(
'ch_total'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_03_23_184642_create_ensino_coordenacao_table.php
View file @
e119449a
...
@@ -23,6 +23,7 @@ class CreateEnsinoCoordenacaoTable extends Migration
...
@@ -23,6 +23,7 @@ class CreateEnsinoCoordenacaoTable extends Migration
$table
->
integer
(
'ch_semanal'
)
->
notNull
();
$table
->
integer
(
'ch_semanal'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
database/migrations/2022_03_23_190559_create_ensino_orientacoes_table.php
View file @
e119449a
...
@@ -24,6 +24,7 @@ class CreateEnsinoOrientacoesTable extends Migration
...
@@ -24,6 +24,7 @@ class CreateEnsinoOrientacoesTable extends Migration
$table
->
integer
(
'ch_semanal'
)
->
notNull
();
$table
->
integer
(
'ch_semanal'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
});
}
}
...
...
Prev
1
2
3
4
Next
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