Commit db05d14c authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

mergin

parents 0e5ea578 07d2782b
......@@ -2,65 +2,85 @@
namespace App\Models;
use App\Models\Util\Status;
use App\Queries\UserQuery;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Illuminate\Validation\ValidationException;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
use HasApiTokens, HasFactory, Notifiable, SoftDeletes;
protected $table = "users";
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = ['name', 'email', 'password', 'document', 'status', 'curso_id', 'campus_id'];
protected $fillable = ['name', 'email', 'password', 'status', 'curso_id', 'campus_id'];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = ['password', 'remember_token'];
/**
* The attributes that should be cast.
*
* @var array<string, string>
* @var boolean $isUpdate
*/
protected $casts = [
'email_verified_at' => 'datetime'
];
/**
* Validar os campos de acordo com as regras implementadas
*
*/
public static function validator($attributes, $rule_password = false) {
protected $dates = ['deleted_at'];
public static function validator(array $attributes, $id = null)
{
$rules = [
'email' => ['required', 'email', ],
'name' => ['required', ]
'name' => ['required', 'min:4'],
'email' => ['required', 'email', Rule::unique('users')->ignore($id)],
'curso_id' => ['integer'],
'campus_id' => ['integer'],
'status' => [
Rule::requiredIf ( function() use($id)
{
return (bool) $id;
}),
Rule::in([Status::ATIVO, Status::INATIVO]),
'required_with:id',
'integer',
],
];
if($rule_password) {
$rules = [
'password' => ['required', 'min:6'],
'password_confirmation' => [],
];
}
$messages = [
// 'unique' => "O :attribute já está registrado no sistema",
'required' => "O :attribute precisa ser preenchido",
//name
'name.min' => 'O campo "Nome" dever ter no mínimo 4 caracteres.',
'name.required' => 'O campo "Nome" é obrigatório.',
//email
'email.required' => 'O campo "E-Mail" é obrigatório.',
'email.email' => 'O campo "E-Mail" deve conter um e-mail valido.',
'email.unique' => 'O "E-Mail" informado já foi cadastrado no sistema.',
//status
'status.required' => 'O campo "Status" é obrigatório.',
'status.in' => 'Selecione uma opção da lista de "Status"!',
'status.integer' => 'O campo "Status" deve cónter um inteiro!',
//curso_id
'curso_id.integer' => 'O campo "Curso" deve cónter um inteiro!',
//campus_id
'campus_id.integer' => 'O campo "Campus" deve cónter um inteiro!',
];
try {
......@@ -68,9 +88,59 @@ class User extends Authenticatable
} catch(ValidationException $exception) {
}
}
public static function validatorPassword(array $attributes)
{
$rules = [
'password' => ['required', 'min:8', 'max:255', 'confirmed'],
];
$messages = [
'password.required' => 'A "Senha" é obrigatória!',
'password.min' => 'A "Senha" deve contér no minímo 8 caracteres!',
'password.max' => 'A campo "Senha" deve contér no máximo 255 caracteres!',
'password.confirmed' => 'As senhas devem ser iguais!',
];
try{
return Validator::make($attributes, $rules, $messages);
} catch(ValidationException $exception) {
}
}
/**
* Validar os campos de acordo com as regras implementadas
*
*/
// public static function validator($attributes, $rule_password = false) {
// $rules = [
// 'name' => ['required'],
// 'email' => ['required', 'email'],
// ];
// if($rule_password) {
// $rules = [
// 'password' => ['required', 'min:8'],
// 'password_confirmation' => [],
// ];
// }
// $messages = [
// // 'unique' => "O :attribute já está registrado no sistema",
// 'required' => "O :attribute precisa ser preenchido",
// ];
// try {
// return Validator::make($attributes, $rules, $messages);
// } catch(ValidationException $exception) {
// }
// }
/**
* Get Curso with curso.id = user.curso_id
*
......@@ -91,8 +161,13 @@ class User extends Authenticatable
return $this->belongsTo(Unidade::class);
}
public function profile($type_profile)
{
return UserType::initQuery()->whereUser($this->id)->whereType($type_profile)->first();
}
public function perfis()
/** @return UserType[]|null */
public function profiles()
{
return $this->hasMany(UserType::class);
}
......@@ -100,9 +175,9 @@ class User extends Authenticatable
/**
* @return UserType|Null
*/
public function perfilSelected()
public function profileSelected()
{
return $this->perfis()->where('selected', true)->first();
return $this->profiles()->where('selected', true)->first();
}
/**
......@@ -110,7 +185,7 @@ class User extends Authenticatable
*/
public function isTypeAdmin()
{
return $this->perfilSelected()->type === UserType::ADMIN;
return $this->profileSelected()->type === UserType::ADMIN;
}
/**
......@@ -118,7 +193,7 @@ class User extends Authenticatable
*/
public function isTypeTeacher()
{
return $this->perfilSelected()->type === UserType::TEACHER;
return $this->profileSelected()->type === UserType::TEACHER;
}
/**
......@@ -126,7 +201,7 @@ class User extends Authenticatable
*/
public function isTypeDirector()
{
return $this->perfilSelected()->type === UserType::DIRECTOR;
return $this->profileSelected()->type === UserType::DIRECTOR;
}
/**
......@@ -134,7 +209,7 @@ class User extends Authenticatable
*/
public function isTypeCoordinator()
{
return $this->perfilSelected()->type === UserType::COORDINATOR;
return $this->profileSelected()->type === UserType::COORDINATOR;
}
/**
......@@ -142,7 +217,7 @@ class User extends Authenticatable
*/
public function isTypeEvaluator()
{
return $this->perfilSelected()->type === UserType::EVALUATOR;
return $this->profileSelected()->type === UserType::EVALUATOR;
}
public static function initQuery()
......@@ -150,6 +225,22 @@ class User extends Authenticatable
return new UserQuery(get_called_class());
}
public function dashboardName()
{
$name = $this->name;
$split = explode(' ', $name);
$dashboardName = '';
if(count($split) >= 2) {
$dashboardName = array_shift($split) . ' ' . array_shift($split);
} else {
$dashboardName = array_shift($split);
}
return $dashboardName;
}
/**
* @return string
*/
......
......@@ -2,27 +2,112 @@
namespace App\Models;
use App\Models\Tabelas\Ensino\EnsinoAtendimentoDiscente;
use App\Models\Tabelas\Ensino\EnsinoAula;
use App\Models\Tabelas\Ensino\EnsinoCoordenacaoRegencia;
use App\Models\Tabelas\Ensino\EnsinoMembroDocente;
use App\Models\Tabelas\Ensino\EnsinoOrientacao;
use App\Models\Tabelas\Ensino\EnsinoOutros;
use App\Models\Tabelas\Ensino\EnsinoParticipacao;
use App\Models\Tabelas\Ensino\EnsinoProjeto;
use App\Models\Tabelas\Ensino\EnsinoSupervisao;
use App\Models\Tabelas\Extensao\ExtensaoCoordenacao;
use App\Models\Tabelas\Extensao\ExtensaoOrientacao;
use App\Models\Tabelas\Extensao\ExtensaoOutros;
use App\Models\Tabelas\Gestao\GestaoCoordenacaoLaboratoriosDidaticos;
use App\Models\Tabelas\Gestao\GestaoCoordenacaoProgramaInstitucional;
use App\Models\Tabelas\Gestao\GestaoMembroCamaras;
use App\Models\Tabelas\Gestao\GestaoMembroComissao;
use App\Models\Tabelas\Gestao\GestaoMembroConselho;
use App\Models\Tabelas\Gestao\GestaoMembroTitularConselho;
use App\Models\Tabelas\Gestao\GestaoOutros;
use App\Models\Tabelas\Gestao\GestaoRepresentanteUnidadeEducacao;
use App\Models\Tabelas\Pesquisa\PesquisaCoordenacao;
use App\Models\Tabelas\Pesquisa\PesquisaLideranca;
use App\Models\Tabelas\Pesquisa\PesquisaOrientacao;
use App\Models\Tabelas\Pesquisa\PesquisaOutros;
use App\Queries\UserPadQuery;
use App\Models\Pad;
use App\Models\Util\Status;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
//remover tabela de user_pad
class UserPad extends Model
{
use HasFactory;
/** @var string */
protected $table = 'user_pad';
protected $fillable = ['user_id', 'pad_id'];
/** @var array */
protected $fillable = ['id', 'user_id', 'pad_id', 'status'];
public function user() {
return $this->belongsTo(User::class);
}
public function pad() {
return $this->belongsTo(PAD::class);
return $this->belongsTo(Pad::class);
}
public function statusAsText() {
return Status::listStatus($this->status);
}
public static function initQuery() {
return new UserPadQuery(get_called_class());
}
public static function rules() {
return [
];
}
public static function messages() {
return [
];
}
public function totalHoras()
{
$ensinoTotalHoras =
EnsinoAtendimentoDiscente::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoAula::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoCoordenacaoRegencia::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoMembroDocente::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoOrientacao::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoOutros::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoParticipacao::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoProjeto::whereUserPadId($this->id)->sum('ch_semanal')
+ EnsinoSupervisao::whereUserPadId($this->id)->sum('ch_semanal');
$gestaoTotalHoras =
GestaoCoordenacaoLaboratoriosDidaticos::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoCoordenacaoProgramaInstitucional::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoMembroCamaras::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoMembroComissao::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoMembroConselho::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoMembroTitularConselho::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoOutros::whereUserPadId($this->id)->sum('ch_semanal')
+ GestaoRepresentanteUnidadeEducacao::whereUserPadId($this->id)->sum('ch_semanal');
$pesquisaTotalHoras =
PesquisaCoordenacao::whereUserPadId($this->id)->sum('ch_semanal')
+ PesquisaLideranca::whereUserPadId($this->id)->sum('ch_semanal')
+ PesquisaOrientacao::whereUserPadId($this->id)->sum('ch_semanal')
+ PesquisaOutros::whereUserPadId($this->id)->sum('ch_semanal');
$extensaoTotalHoras =
ExtensaoCoordenacao::whereUserPadId($this->id)->sum('ch_semanal')
+ ExtensaoOrientacao::whereUserPadId($this->id)->sum('ch_semanal')
+ ExtensaoOutros::whereUserPadId($this->id)->sum('ch_semanal');
$totalHoras = $ensinoTotalHoras + $gestaoTotalHoras + $pesquisaTotalHoras + $extensaoTotalHoras;
return $totalHoras;
}
}
......@@ -2,13 +2,19 @@
namespace App\Models;
use App\Models\Pad;
use App\Models\Util\Status;
use App\Queries\UserTypeQuery;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Illuminate\Validation\ValidationException;
class UserType extends Model
{
{
use SoftDeletes;
const ADMIN = 1; // Administrador
const TEACHER = 2; // Professor
const DIRECTOR= 3; // Diretor
......@@ -17,27 +23,79 @@ class UserType extends Model
protected $table = 'user_type';
protected $fillable = ['user_id', 'type', 'status', 'selected'];
protected $fillable = ['user_id', 'pad_id', 'type', 'status', 'selected'];
protected $dates = ['deleted_at'];
public function user()
{
return $this->belongsTo(User::class);
}
public function pad()
{
return $this->belongsTo(Pad::class);
}
/**
* @return string
*/
public function typeAsString()
{
return self::listType($this->type);
}
/**
* @return string
*/
public function statusAsString()
{
return Status::listStatus($this->status);
}
public function initQuery()
public static function initQuery()
{
return new UserTypeQuery(get_called_class());
}
public static function rules($id = null, $user_id = null, $type = null) {
return [
//add migration with deleted_at column
'user_id' => ['required', 'integer'],
'status' => ['required', 'integer', Rule::in([Status::ATIVO, Status::INATIVO])],
// 'selected' => []
'type' => [
'required',
'integer',
Rule::in(array_keys(self::listType())),
Rule::unique('user_type')->where(function($query) use($id, $user_id, $type)
{
return $query->where('user_id', '=', $user_id)->where('type', '=', $type);
})->ignore($id)
],
];
}
public static function messages() {
return [
//user_id
//type
'type.required' => 'O campo "Papel" é obrigatório!',
'type.in' => 'Selecione uma opção da lista de "Papeis"!',
'type.integer' => 'O campo "Papel" deve cónter um inteiro!',
'type.unique' => 'A opção do campo "Papel" já foi cadastrada!',
//status
'status.required' => 'O campo "Status" é obrigatório!',
'status.in' => 'Selecione uma opção da lista de "Status"!',
'status.integer' => 'O campo "Status" deve cónter um inteiro!',
//selected
];
}
public static function listType($value = null) {
......
......@@ -6,6 +6,8 @@ class CargaHorariaValidation
{
public const CH_MIN = 'min:1';
public const CH_MAX = '';
public const CH_MIN_DOUBLE = 'min:0.5';
/** @var integer|null */
public $ch_min;
......@@ -16,11 +18,15 @@ class CargaHorariaValidation
/** @var array */
public $multiplier;
public function __construct($ch_min, $ch_max, $multiplier = [])
/** @var double */
public $is_double;
public function __construct($ch_min, $ch_max, $multiplier = [], $is_double = false)
{
$this->ch_min = $ch_min;
$this->ch_max = $ch_max;
$this->multiplier = $multiplier;
$this->is_double = $is_double;
}
public function rules()
......@@ -29,8 +35,15 @@ class CargaHorariaValidation
$ch_max = $this->ch_max !== null? sprintf('max:%d', $this->ch_max) : self::CH_MAX;
if($this->is_double)
{
$ch_min = $this->ch_min !== null? sprintf('min:%.2f', $this->ch_min) : self::CH_MIN_DOUBLE;
$ch_max = $this->ch_max !== null? sprintf('max:%.2f', $this->ch_max) : self::CH_MAX;
}
return [
'ch_semanal' => ['required', 'integer', $ch_min, $ch_max]
'ch_semanal' => ['required', 'numeric', $ch_min, $ch_max]
];
}
......@@ -44,10 +57,17 @@ class CargaHorariaValidation
{
$ch_max = sprintf('"CH. Semanal" máxima para o preenchimento é de %d Hora(s)! Valor multiplicado pelo campo "%s" está acima da "CH. Semanal" máxima!', $this->ch_max, $this->multiplier['field']);
}
if($this->is_double)
{
$ch_min = $this->ch_min !== null && $this->ch_min > 0.5 ? sprintf('"CH. Semanal" miníma é de %.2f Hora(s)!', $this->ch_min) : '"CH. Semanal" miníma é de 0.5 Hora(s)!';
$ch_max = $this->ch_max !== null ? sprintf('"CH. Semanal" máxima para o preenchimento é de %.2f Hora(s)!', $this->ch_max) : '';
}
return [
'ch_semanal.required' => 'O campo "CH. Semanal" é obrigatório!',
'ch_semanal.integer' => '"CH. Semanal" deve conter um inteiro no seguinte formato: 1, 2, 3...!',
'ch_semanal.numeric' => '"CH. Semanal" deve conter um inteiro no seguinte formato: 1, 2, 3...!',
'ch_semanal.min' => $ch_min,
'ch_semanal.max' => $ch_max,
];
......@@ -56,7 +76,7 @@ class CargaHorariaValidation
public static function defaultRules()
{
return [
'ch_semanal' => ['required', 'integer']
'ch_semanal' => ['required', 'numeric']
];
}
......@@ -64,7 +84,7 @@ class CargaHorariaValidation
{
return [
'ch_semanal.required' => 'O campo "CH. Semanal" é obrigatório!',
'ch_semanal.integer' => '"CH. Semanal" deve conter um inteiro no seguinte formato: 1, 2, 3...!',
'ch_semanal.numeric' => '"CH. Semanal" deve conter um número no seguinte formato: 0.5, 1, 1.5, 2, 3...!',
];
}
......
<?php
namespace App\Models\Util;
class Form
{
const TYPE_CREATE = 'create';
const TYPE_UPDATE = 'update';
}
\ No newline at end of file
<?php
namespace App\Models\Util;
class Menu
{
const USER = 1;
const HOME = 2;
const USERS = 3;
const CAMPUS = 4;
const CURSOS = 5;
const UNIDADES = 6;
const PADS = 7;
//Deletar depois
const DIRETORES = 4;
const COORDENADORES = 5;
const PROFESSORES = 7;
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ class Status
const INATIVO = 2;
const PENDENTE = 3;
const ARQUIVADO = 4;
const FINALIZADO = 5;
public static function listStatus($value = null) {
......@@ -17,6 +18,17 @@ class Status
self::INATIVO => 'Inativo',
self::PENDENTE => 'Pendente',
self::ARQUIVADO => 'Arquivado',
self::FINALIZADO => 'Finalizado',
];
return $value !== null? $values[$value] : $values;
}
public static function listUserTypeStatus($value = null) {
$values = [
self::ATIVO => 'Ativo',
self::INATIVO => 'Inativo',
];
return $value !== null? $values[$value] : $values;
......
......@@ -17,7 +17,7 @@ class PadQuery extends CustomQuery
/**
* @param integer $id
* @param string $expression
* @return PAD|null
* @return Pad|null
*/
public function whereUnidadeId(int $id, string $expression = '=')
{
......
......@@ -24,12 +24,12 @@ class UserPadQuery extends CustomQuery
}
/**
* @param integer $user_id
* @param integer $user_type_id
* @return UserPadQuery|Builder
*/
public function whereUser($user_id, $operator = '=')
public function whereUser($user_type_id, $operator = '=')
{
$this->query = $this->query->where('user_id', $operator, $user_id);
$this->query = $this->query->where('user_id', $operator, $user_type_id);
return self::$instance;
}
......@@ -43,6 +43,16 @@ class UserPadQuery extends CustomQuery
return self::$instance;
}
/**
* @param integer $status
* @return UserPadQuery|Builder
*/
public function whereStatus($status, $operator = '=')
{
$this->query = $this->query->where('status', $operator, $status);
return self::$instance;
}
/**
* @param integer $status
* @return UserPadQuery|Builder
......
......@@ -24,6 +24,16 @@ class UserQuery extends CustomQuery
return self::$instance;
}
/**
* @param integer $name
* @return UserQuery|Builder
*/
public function whereName($name, $operator = 'LIKE')
{
$this->query = $this->query->where('name', $operator, $name);
return self::$instance;
}
/**
* @param integer $email
* @return UserQuery|Builder
......@@ -34,6 +44,36 @@ class UserQuery extends CustomQuery
return self::$instance;
}
/**
* @param integer $status
* @return UserQuery|Builder
*/
public function whereStatus($status, $operator = '=')
{
$this->query = $this->query->where('status', $operator, $status);
return self::$instance;
}
/**
* @param integer $curso_id
* @return UserQuery|Builder
*/
public function whereCurso($curso_id, $operator = '=')
{
$this->query = $this->query->where('curso_id', $operator, $curso_id);
return self::$instance;
}
/**
* @param integer $campus_id
* @return UserQuery|Builder
*/
public function whereCampus($campus_id, $operator = '=')
{
$this->query = $this->query->where('campus_id', $operator, $campus_id);
return self::$instance;
}
/**
* @param integer $type
* @return UserQuery|Builder
......
......@@ -13,5 +13,25 @@ class UserTypeQuery extends CustomQuery
self::$instance = $this;
}
public function whereType($type, $expression = "=")
{
$this->query = $this->query->where('type', $expression, $type);
return self::$instance;
}
public function whereUser($user_id, $expression = "=")
{
$this->query = $this->query->where('user_id', $expression, $user_id);
return self::$instance;
}
public function whereStatus($status, $expression = "=")
{
$this->query = $this->query->where('status', $expression, $status);
return self::$instance;
}
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "26499a0da4e1ffc865fe743648cc4f87",
"content-hash": "32687fca5180d3909111b0fee71aecf6",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -827,6 +827,67 @@
],
"time": "2020-12-29T14:50:06+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.16.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8",
"reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8",
"shasum": ""
},
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-tidy": "Used for pretty-printing HTML"
},
"type": "library",
"autoload": {
"files": [
"library/HTMLPurifier.composer.php"
],
"psr-0": {
"HTMLPurifier": "library/"
},
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0"
},
"time": "2022-09-18T07:06:19+00:00"
},
{
"name": "fruitcake/laravel-cors",
"version": "v2.2.0",
......@@ -2003,6 +2064,270 @@
],
"time": "2022-04-17T13:12:02+00:00"
},
{
"name": "maatwebsite/excel",
"version": "3.1.44",
"source": {
"type": "git",
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
"reference": "289c3320982510dacfe0dd00de68061a2b7f4a43"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/289c3320982510dacfe0dd00de68061a2b7f4a43",
"reference": "289c3320982510dacfe0dd00de68061a2b7f4a43",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/support": "5.8.*|^6.0|^7.0|^8.0|^9.0",
"php": "^7.0|^8.0",
"phpoffice/phpspreadsheet": "^1.18",
"psr/simple-cache": "^1.0|^2.0"
},
"require-dev": {
"orchestra/testbench": "^6.0|^7.0",
"predis/predis": "^1.1"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Maatwebsite\\Excel\\ExcelServiceProvider"
],
"aliases": {
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
}
}
},
"autoload": {
"psr-4": {
"Maatwebsite\\Excel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "patrick@spartner.nl"
}
],
"description": "Supercharged Excel exports and imports in Laravel",
"keywords": [
"PHPExcel",
"batch",
"csv",
"excel",
"export",
"import",
"laravel",
"php",
"phpspreadsheet"
],
"support": {
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.44"
},
"funding": [
{
"url": "https://laravel-excel.com/commercial-support",
"type": "custom"
},
{
"url": "https://github.com/patrickbrouwers",
"type": "github"
}
],
"time": "2022-10-14T20:01:10+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "2.2.6",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f",
"reference": "30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f",
"shasum": ""
},
"require": {
"myclabs/php-enum": "^1.5",
"php": "^7.4 || ^8.0",
"psr/http-message": "^1.0",
"symfony/polyfill-mbstring": "^1.0"
},
"require-dev": {
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.9",
"guzzlehttp/guzzle": "^6.5.3 || ^7.2.0",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.4",
"phpunit/phpunit": "^8.5.8 || ^9.4.2",
"vimeo/psalm": "^4.1"
},
"type": "library",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.6"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
},
{
"url": "https://opencollective.com/zipstream",
"type": "open_collective"
}
],
"time": "2022-11-25T18:57:19+00:00"
},
{
"name": "markbaker/complex",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
"time": "2022-12-06T16:21:08+00:00"
},
{
"name": "markbaker/matrix",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
"time": "2022-12-02T22:17:43+00:00"
},
{
"name": "monolog/monolog",
"version": "2.8.0",
......@@ -2105,6 +2430,69 @@
],
"time": "2022-07-24T11:55:47+00:00"
},
{
"name": "myclabs/php-enum",
"version": "1.8.4",
"source": {
"type": "git",
"url": "https://github.com/myclabs/php-enum.git",
"reference": "a867478eae49c9f59ece437ae7f9506bfaa27483"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483",
"reference": "a867478eae49c9f59ece437ae7f9506bfaa27483",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.3 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "1.*",
"vimeo/psalm": "^4.6.2"
},
"type": "library",
"autoload": {
"psr-4": {
"MyCLabs\\Enum\\": "src/"
},
"classmap": [
"stubs/Stringable.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP Enum contributors",
"homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
}
],
"description": "PHP Enum implementation",
"homepage": "http://github.com/myclabs/php-enum",
"keywords": [
"enum"
],
"support": {
"issues": "https://github.com/myclabs/php-enum/issues",
"source": "https://github.com/myclabs/php-enum/tree/1.8.4"
},
"funding": [
{
"url": "https://github.com/mnapoli",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
"type": "tidelift"
}
],
"time": "2022-08-04T09:53:51+00:00"
},
{
"name": "nesbot/carbon",
"version": "2.65.0",
......@@ -2475,6 +2863,111 @@
},
"time": "2022-01-27T09:35:39+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.25.2",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "a317a09e7def49852400a4b3eca4a4b0790ceeb5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a317a09e7def49852400a4b3eca4a4b0790ceeb5",
"reference": "a317a09e7def49852400a4b3eca4a4b0790ceeb5",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.15",
"maennchen/zipstream-php": "^2.1",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": "^7.3 || ^8.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"dompdf/dompdf": "^1.0 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "10.2.4",
"mpdf/mpdf": "8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.25.2"
},
"time": "2022-09-25T17:21:01+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.9.0",
......
......@@ -165,6 +165,7 @@ return [
/*
* Package Service Providers...
*/
Maatwebsite\Excel\ExcelServiceProvider::class,
/*
* Application Service Providers...
......@@ -229,6 +230,7 @@ return [
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
],
......
......@@ -19,7 +19,6 @@ class CreateUsersTable extends Migration
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('document');
$table->tinyInteger('status');
$table->foreignId('curso_id')->nullable();
$table->foreignId('campus_id')->nullable();
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePADSTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pads', function (Blueprint $table) {
$table->id();
$table->integer('ano')->default(false);
$table->integer('semestre')->default(false);
$table->integer('carga_horaria')->default(false);
$table->string('categoria', 20)->default(false);
$table->boolean('afastamento_total')->default(false);
$table->boolean('afastamento_parcial')->default(false);
$table->boolean('exerce_funcao_admin')->default(false);
$table->boolean('exerce_funcao_sindical')->default(false);
$table->string('licenca_de_acor_legais', 50)->default(null);
$table->string('outras_observacoes', 200)->nullable(true);
$table->foreignId('user_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pads');
}
}
......@@ -13,10 +13,12 @@ class CreateUserPadTable extends Migration
*/
public function up()
{
Schema::create('user_pad', function (Blueprint $table) {
Schema::create('user_pad', function (Blueprint $table)
{
$table->id();
$table->foreignId('user_id');
$table->foreignId('user_type_id');
$table->foreignId('pad_id');
$table->tinyInteger('status');
$table->timestamps();
});
}
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterUserPadTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_pad', function (Blueprint $table) {
$table->dropColumn('user_type_id');
$table->foreignId('user_id')->after('id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('user_pad', function (Blueprint $table) {
$table->dropColumn('user_id');
$table->foreignId('user_type_id')->after('id');
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterChColumnsPlanejamentoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('planejamentos', function(Blueprint $table) {
$table->decimal('ch_semanal', 4, 2)->change();
$table->decimal('ch_maxima', 4, 2)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('planejamentos', function(Blueprint $table) {
$table->integer('ch_semanal')->change();
$table->integer('ch_maxima')->change();
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterExtensaoCoordenacaoAddCodDimensaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('extensao_coordenacao', function(Blueprint $table) {
$table->string('cod_dimensao')->after('atividade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('extensao_coordenacao', function (Blueprint $table) {
$table->dropColumn('cod_dimensao');
});
}
}
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