Commit 319e67d8 authored by carlos's avatar carlos
Browse files

crud naturezas

parent 7387b6c8
......@@ -10,6 +10,7 @@ use App\Avaliador;
use App\AdministradorResponsavel;
use App\Participante;
use App\Proponente;
use App\Natureza;
use Illuminate\Support\Facades\Hash;
use App\Evento;
......@@ -20,8 +21,8 @@ class AdministradorController extends Controller
return view('administrador.index');
}
public function naturezas(){
return view('naturezas.index');
$naturezas = Natureza::orderBy('nome')->get();
return view('naturezas.index')->with(['naturezas' => $naturezas]);
}
public function usuarios(){
$users = User::orderBy('name')->get();
......
......@@ -304,20 +304,20 @@ class EventoController extends Controller
{
$evento = Evento::find($id);
$areas = Area::where('eventoId', $id);
// $areas = Area::where('eventoId', $id);
$atividades = Atividade::where('eventoId', $id);
$comissao = ComissaoEvento::where('eventosId', $id);
$revisores = Revisor::where('eventoId', $id);
$trabalhos = Trabalho::where('eventoId', $id);
$trabalhos = Trabalho::where('evento_id', $id);
if(isset($areas)){
$areas->delete();
}
// if(isset($areas)){
// $areas->delete();
// }
if(isset($atividades)){
$atividades->delete();
$atividades->delete();
}
if(isset($comissao)){
$comissao->delete();
$comissao->delete();
}
if(isset($revisores)){
$revisores->delete();
......
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Natureza;
class NaturezaController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validated = $request->validate([
'nome' => 'required'
]);
$natureza = new Natureza();
$natureza->nome = $request->nome;
$natureza->save();
return redirect( route('admin.naturezas') )->with(['mensagem' => 'Natureza salva 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)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$validated = $request->validate([
'nomeEditavel' => 'required',
]);
$natureza = Natureza::find($id);
$natureza->nome = $request->nomeEditavel;
$natureza->update();
return redirect( route('admin.naturezas') )->with(['mensagem' => "Natureza editada com sucesso"]);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$natureza = Natureza::find($id);
$natureza->delete();
return redirect( route('admin.naturezas') )->with(['mensagem' => "Natureza deletada com sucesso"]);
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Natureza extends Model
{
//
}
......@@ -41,16 +41,16 @@
},
{
"name": "doctrine/inflector",
"version": "2.0.2",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "3fc171224a316569faad2df6b18a1fd8cce5a56d"
"reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/3fc171224a316569faad2df6b18a1fd8cce5a56d",
"reference": "3fc171224a316569faad2df6b18a1fd8cce5a56d",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210",
"reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210",
"shasum": ""
},
"require": {
......@@ -114,7 +114,7 @@
"uppercase",
"words"
],
"time": "2020-05-25T20:08:47+00:00"
"time": "2020-05-29T15:13:26+00:00"
},
{
"name": "doctrine/lexer",
......@@ -1090,16 +1090,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.34.2",
"version": "2.35.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "3e87404329b8072295ea11d548b47a1eefe5a162"
"reference": "4b9bd835261ef23d36397a46a76b496a458305e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/3e87404329b8072295ea11d548b47a1eefe5a162",
"reference": "3e87404329b8072295ea11d548b47a1eefe5a162",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4b9bd835261ef23d36397a46a76b496a458305e5",
"reference": "4b9bd835261ef23d36397a46a76b496a458305e5",
"shasum": ""
},
"require": {
......@@ -1159,7 +1159,7 @@
"datetime",
"time"
],
"time": "2020-05-19T22:14:16+00:00"
"time": "2020-05-24T18:27:52+00:00"
},
{
"name": "nikic/php-parser",
......@@ -1831,22 +1831,23 @@
},
{
"name": "symfony/console",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7"
"reference": "326b064d804043005526f5a0494cfb49edb59bb0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/10bb3ee3c97308869d53b3e3d03f6ac23ff985f7",
"reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7",
"url": "https://api.github.com/repos/symfony/console/zipball/326b064d804043005526f5a0494cfb49edb59bb0",
"reference": "326b064d804043005526f5a0494cfb49edb59bb0",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8",
"symfony/polyfill-php80": "^1.15",
"symfony/service-contracts": "^1.1|^2"
},
"conflict": {
......@@ -1903,29 +1904,29 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2020-03-30T11:41:10+00:00"
"time": "2020-05-30T20:06:45+00:00"
},
{
"name": "symfony/css-selector",
"version": "v5.0.8",
"version": "v5.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "5f8d5271303dad260692ba73dfa21777d38e124e"
"reference": "e544e24472d4c97b2d11ade7caacd446727c6bf9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/5f8d5271303dad260692ba73dfa21777d38e124e",
"reference": "5f8d5271303dad260692ba73dfa21777d38e124e",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/e544e24472d4c97b2d11ade7caacd446727c6bf9",
"reference": "e544e24472d4c97b2d11ade7caacd446727c6bf9",
"shasum": ""
},
"require": {
"php": "^7.2.5"
"php": ">=7.2.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0-dev"
"dev-master": "5.1-dev"
}
},
"autoload": {
......@@ -1956,25 +1957,26 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2020-03-27T16:56:45+00:00"
"time": "2020-05-20T17:43:50+00:00"
},
{
"name": "symfony/debug",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "346636d2cae417992ecfd761979b2ab98b339a45"
"reference": "28f92d08bb6d1fddf8158e02c194ad43870007e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/346636d2cae417992ecfd761979b2ab98b339a45",
"reference": "346636d2cae417992ecfd761979b2ab98b339a45",
"url": "https://api.github.com/repos/symfony/debug/zipball/28f92d08bb6d1fddf8158e02c194ad43870007e6",
"reference": "28f92d08bb6d1fddf8158e02c194ad43870007e6",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/log": "~1.0"
"php": ">=7.1.3",
"psr/log": "~1.0",
"symfony/polyfill-php80": "^1.15"
},
"conflict": {
"symfony/http-kernel": "<3.4"
......@@ -2012,26 +2014,27 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2020-03-27T16:54:36+00:00"
"time": "2020-05-24T08:33:35+00:00"
},
{
"name": "symfony/error-handler",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
"reference": "7e9828fc98aa1cf27b422fe478a84f5b0abb7358"
"reference": "0df9a23c0f9eddbb6682479fee6fd58b88add75b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/7e9828fc98aa1cf27b422fe478a84f5b0abb7358",
"reference": "7e9828fc98aa1cf27b422fe478a84f5b0abb7358",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/0df9a23c0f9eddbb6682479fee6fd58b88add75b",
"reference": "0df9a23c0f9eddbb6682479fee6fd58b88add75b",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"psr/log": "~1.0",
"symfony/debug": "^4.4.5",
"symfony/polyfill-php80": "^1.15",
"symfony/var-dumper": "^4.4|^5.0"
},
"require-dev": {
......@@ -2068,24 +2071,24 @@
],
"description": "Symfony ErrorHandler Component",
"homepage": "https://symfony.com",
"time": "2020-03-30T14:07:33+00:00"
"time": "2020-05-28T10:39:14+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "abc8e3618bfdb55e44c8c6a00abd333f831bbfed"
"reference": "a5370aaa7807c7a439b21386661ffccf3dff2866"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/abc8e3618bfdb55e44c8c6a00abd333f831bbfed",
"reference": "abc8e3618bfdb55e44c8c6a00abd333f831bbfed",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5370aaa7807c7a439b21386661ffccf3dff2866",
"reference": "a5370aaa7807c7a439b21386661ffccf3dff2866",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/event-dispatcher-contracts": "^1.1"
},
"conflict": {
......@@ -2138,7 +2141,7 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2020-03-27T16:54:36+00:00"
"time": "2020-05-20T08:37:50+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
......@@ -2200,7 +2203,7 @@
},
{
"name": "symfony/finder",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
......@@ -2249,20 +2252,20 @@
},
{
"name": "symfony/http-foundation",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "ec5bd254c223786f5fa2bb49a1e705c1b8e7cee2"
"reference": "3adfbd7098c850b02d107330b7b9deacf2581578"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/ec5bd254c223786f5fa2bb49a1e705c1b8e7cee2",
"reference": "ec5bd254c223786f5fa2bb49a1e705c1b8e7cee2",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/3adfbd7098c850b02d107330b7b9deacf2581578",
"reference": "3adfbd7098c850b02d107330b7b9deacf2581578",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/mime": "^4.3|^5.0",
"symfony/polyfill-mbstring": "~1.1"
},
......@@ -2300,30 +2303,31 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2020-04-18T20:40:08+00:00"
"time": "2020-05-23T09:11:46+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "1799a6c01f0db5851f399151abdb5d6393fec277"
"reference": "54526b598d7fc86a67850488b194a88a79ab8467"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/1799a6c01f0db5851f399151abdb5d6393fec277",
"reference": "1799a6c01f0db5851f399151abdb5d6393fec277",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/54526b598d7fc86a67850488b194a88a79ab8467",
"reference": "54526b598d7fc86a67850488b194a88a79ab8467",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"psr/log": "~1.0",
"symfony/error-handler": "^4.4",
"symfony/event-dispatcher": "^4.4",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-php73": "^1.9"
"symfony/polyfill-php73": "^1.9",
"symfony/polyfill-php80": "^1.15"
},
"conflict": {
"symfony/browser-kit": "<4.3",
......@@ -2390,26 +2394,27 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2020-04-28T18:47:42+00:00"
"time": "2020-05-31T05:25:51+00:00"
},
{
"name": "symfony/mime",
"version": "v5.0.8",
"version": "v5.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "5d6c81c39225a750f3f43bee15f03093fb9aaa0b"
"reference": "56261f89385f9d13cf843a5101ac72131190bc91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/5d6c81c39225a750f3f43bee15f03093fb9aaa0b",
"reference": "5d6c81c39225a750f3f43bee15f03093fb9aaa0b",
"url": "https://api.github.com/repos/symfony/mime/zipball/56261f89385f9d13cf843a5101ac72131190bc91",
"reference": "56261f89385f9d13cf843a5101ac72131190bc91",
"shasum": ""
},
"require": {
"php": "^7.2.5",
"php": ">=7.2.5",
"symfony/polyfill-intl-idn": "^1.10",
"symfony/polyfill-mbstring": "^1.0"
"symfony/polyfill-mbstring": "^1.0",
"symfony/polyfill-php80": "^1.15"
},
"conflict": {
"symfony/mailer": "<4.4"
......@@ -2421,7 +2426,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0-dev"
"dev-master": "5.1-dev"
}
},
"autoload": {
......@@ -2452,7 +2457,7 @@
"mime",
"mime-type"
],
"time": "2020-04-17T03:29:44+00:00"
"time": "2020-05-25T12:33:44+00:00"
},
{
"name": "symfony/polyfill-ctype",
......@@ -2805,18 +2810,80 @@
],
"time": "2020-05-12T16:47:27+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd",
"reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd",
"shasum": ""
},
"require": {
"php": ">=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2020-05-12T16:47:27+00:00"
},
{
"name": "symfony/process",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "4b6a9a4013baa65d409153cbb5a895bf093dc7f4"
"reference": "c714958428a85c86ab97e3a0c96db4c4f381b7f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/4b6a9a4013baa65d409153cbb5a895bf093dc7f4",
"reference": "4b6a9a4013baa65d409153cbb5a895bf093dc7f4",
"url": "https://api.github.com/repos/symfony/process/zipball/c714958428a85c86ab97e3a0c96db4c4f381b7f5",
"reference": "c714958428a85c86ab97e3a0c96db4c4f381b7f5",
"shasum": ""
},
"require": {
......@@ -2852,20 +2919,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2020-04-15T15:56:18+00:00"
"time": "2020-05-30T20:06:45+00:00"
},
{
"name": "symfony/routing",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "67b4e1f99c050cbc310b8f3d0dbdc4b0212c052c"
"reference": "0f557911dde75c2a9652b8097bd7c9f54507f646"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/67b4e1f99c050cbc310b8f3d0dbdc4b0212c052c",
"reference": "67b4e1f99c050cbc310b8f3d0dbdc4b0212c052c",
"url": "https://api.github.com/repos/symfony/routing/zipball/0f557911dde75c2a9652b8097bd7c9f54507f646",
"reference": "0f557911dde75c2a9652b8097bd7c9f54507f646",
"shasum": ""
},
"require": {
......@@ -2928,24 +2995,24 @@
"uri",
"url"
],
"time": "2020-04-21T19:59:53+00:00"
"time": "2020-05-30T20:07:26+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v2.0.1",
"version": "v2.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "144c5e51266b281231e947b51223ba14acf1a749"
"reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749",
"reference": "144c5e51266b281231e947b51223ba14acf1a749",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/66a8f0957a3ca54e4f724e49028ab19d75a8918b",
"reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b",
"shasum": ""
},
"require": {
"php": "^7.2.5",
"php": ">=7.2.5",
"psr/container": "^1.0"
},
"suggest": {
......@@ -2954,7 +3021,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
},
"autoload": {
......@@ -2986,24 +3053,24 @@
"interoperability",
"standards"
],
"time": "2019-11-18T17:27:11+00:00"
"time": "2020-05-20T17:43:50+00:00"
},
{
"name": "symfony/translation",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "8272bbd2b7e220ef812eba2a2b30068a5c64b191"
"reference": "79d3ef9096a6a6047dbc69218b68c7b7f63193af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/8272bbd2b7e220ef812eba2a2b30068a5c64b191",
"reference": "8272bbd2b7e220ef812eba2a2b30068a5c64b191",
"url": "https://api.github.com/repos/symfony/translation/zipball/79d3ef9096a6a6047dbc69218b68c7b7f63193af",
"reference": "79d3ef9096a6a6047dbc69218b68c7b7f63193af",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/translation-contracts": "^1.1.6|^2"
},
......@@ -3062,24 +3129,24 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2020-04-12T16:45:36+00:00"
"time": "2020-05-30T20:06:45+00:00"
},
{
"name": "symfony/translation-contracts",
"version": "v2.0.1",
"version": "v2.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
"reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed"
"reference": "e5ca07c8f817f865f618aa072c2fe8e0e637340e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed",
"reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e5ca07c8f817f865f618aa072c2fe8e0e637340e",
"reference": "e5ca07c8f817f865f618aa072c2fe8e0e637340e",
"shasum": ""
},
"require": {
"php": "^7.2.5"
"php": ">=7.2.5"
},
"suggest": {
"symfony/translation-implementation": ""
......@@ -3087,7 +3154,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
},
"autoload": {
......@@ -3119,26 +3186,27 @@
"interoperability",
"standards"
],
"time": "2019-11-18T17:27:11+00:00"
"time": "2020-05-20T17:43:50+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v4.4.8",
"version": "v4.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "c587e04ce5d1aa62d534a038f574d9a709e814cf"
"reference": "56b3aa5eab0ac6720dcd559fd1d590ce301594ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c587e04ce5d1aa62d534a038f574d9a709e814cf",
"reference": "c587e04ce5d1aa62d534a038f574d9a709e814cf",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/56b3aa5eab0ac6720dcd559fd1d590ce301594ac",
"reference": "56b3aa5eab0ac6720dcd559fd1d590ce301594ac",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": ">=7.1.3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php72": "~1.5"
"symfony/polyfill-php72": "~1.5",
"symfony/polyfill-php80": "^1.15"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
......@@ -3195,7 +3263,7 @@
"debug",
"dump"
],
"time": "2020-04-12T16:14:02+00:00"
"time": "2020-05-30T20:06:45+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
......@@ -3313,20 +3381,20 @@
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.3.0",
"version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1"
"reference": "f350df0268e904597e3bd9c4685c53e0e333feea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1",
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea",
"reference": "f350df0268e904597e3bd9c4685c53e0e333feea",
"shasum": ""
},
"require": {
"php": "^7.1"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
......@@ -3365,7 +3433,7 @@
"constructor",
"instantiate"
],
"time": "2019-10-21T16:45:58+00:00"
"time": "2020-05-29T17:27:14+00:00"
},
{
"name": "facade/flare-client-php",
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNaturezasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('naturezas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nome');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('naturezas');
}
}
......@@ -22,6 +22,7 @@ class DatabaseSeeder extends Seeder
$this->call(FuncaoParticipanteSeeder::class);
$this->call(CoordenadorComissaoSeeder::class);
$this->call(ParticipanteSeeder::class);
$this->call(NaturezaSeeder::class);
// $this->call(UsersTableSeeder::class);
......
<?php
use Illuminate\Database\Seeder;
class NaturezaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('naturezas')->insert([
'nome' => 'Ensino',
]);
DB::table('naturezas')->insert([
'nome' => 'Pesquisa',
]);
DB::table('naturezas')->insert([
'nome' => 'Extensão',
]);
}
}
......@@ -19,7 +19,7 @@
</div>
<div class="col-sm-3 d-flex justify-content-center">
<a href="{{ route('grandearea.index') }}" style="text-decoration:none; color: inherit;">
<a href="{{ route('admin.naturezas') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center " style="border-radius: 30px; width: 13rem;height: 15rem;">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Natureza</h2>
......
......@@ -2,43 +2,150 @@
@section('content')
<div class="container">
<h2 style="margin-top: 100px; ">Administrador</h2>
<div class="row justify-content-center d-flex align-items-center">
<div class="col-sm-4 d-flex justify-content-center ">
<a href="{{ route('grandearea.index') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center " style="border-radius: 30px; width: 18rem;">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Grande Area</h2>
</div>
</div>
</a>
<div class="container" >
{{-- Modal criar nova natureza --}}
<div class="modal fade" id="modalNewCenter" tabindex="-1" role="dialog" aria-labelledby="modalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">{{__('Nova natureza')}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="formNew" method="POST" action="{{ route('natureza.salvar') }}">
@csrf
<input form="formNew" type="text" value="" class="form-control @error('nome') is-invalid @enderror" name="nome" required autocomplete="nome" autofocus>
@error('nome')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{__('Cancelar')}}</button>
<button type="button" onclick="submeterFormNew()" class="btn btn-primary">{{__('Salvar')}}</button>
</div>
</div>
</div>
</div>
<div class="row" >
@if(session('mensagem'))
<div class="col-md-12" style="margin-top: 100px;">
<div class="alert alert-success">
<p>{{session('mensagem')}}</p>
</div>
</div>
<div class="col-sm-4 d-flex justify-content-center">
<a href="{{ route('area.index') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center " style="border-radius: 30px; width: 18rem;">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Area</h2>
</div>
</div>
</a>
@endif
<div class="col-sm-9">
<h2 style="margin-top: 100px; ">{{ __('Naturezas') }}</h2>
</div>
<div class="col-sm-4 d-flex justify-content-center">
<a href="{{ route('subarea.index') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center " style="border-radius: 30px; width: 18rem;">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Subárea</h2>
</div>
</div>
</a>
<div class="col-sm-3">
<a href="" class="btn btn-primary" style="position:relative;top:100px;" data-toggle="modal" data-target="#modalNewCenter">{{ __('Criar natureza') }}</a>
</div>
</div>
</div>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome</th>
<th scope="col">Data de criação</th>
<th scope="col">Opção</th>
</tr>
</thead>
<tbody>
@foreach ($naturezas as $natureza)
<!-- Modal Editar -->
<div class="modal fade" id="modalEditCenter{{$natureza->id}}" tabindex="-1" role="dialog" aria-labelledby="modalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">{{__('Editar natureza')}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="formEdit{{ $natureza->id }}" action="{{ route('natureza.atualizar', ['id' => $natureza->id]) }}">
@csrf
<input form="formEdit{{ $natureza->id }}" type="text" value="{{ $natureza->nome }}" class="form-control @error('nomeEditavel') is-invalid @enderror" name="nomeEditavel" required autocomplete="nome" autofocus>
@error('nomeEditavel')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{__('Cancelar')}}</button>
<button type="button" onclick="submeterFormEdit('{{ $natureza->id }}')" class="btn btn-primary">{{__('Salvar')}}</button>
</div>
</div>
</div>
</div>
<!-- Modal Excluir -->
<div class="modal fade" id="modalDelCenter{{$natureza->id}}" tabindex="-1" role="dialog" aria-labelledby="modalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">{{__('Deletar natureza')}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
{{__('Tem certeza que deseja deletar essa natureza?')}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{__('Não')}}</button>
<a href="{{ route('natureza.deletar', ['id' => $natureza->id]) }}" type="button" onclick="submeterFormDel('{{ $natureza->id }}')" class="btn btn-primary">{{__('Sim')}}</a>
</div>
</div>
</div>
</div>
<tr>
<td>
{{ $natureza->nome }}
</td>
<td>
{{$natureza->creat_at}}
</td>
<td>
<div class="btn-group dropright dropdown-options">
<a id="options" class="dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
</a>
<div class="dropdown-menu">
<a class="dropdown-item" data-toggle="modal" data-target="#modalEditCenter{{$natureza->id}}" class="dropdown-item">
<img src="{{asset('img/icons/edit-regular.svg')}}" class="icon-card" alt="">
{{__('Editar')}}
</a>
<a class="dropdown-item" data-toggle="modal" data-target="#modalDelCenter{{$natureza->id}}" class="dropdown-item">
<img src="{{asset('img/icons/trash-alt-regular.svg')}}" class="icon-card" alt="">
{{__('Deletar')}}
</a>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
@section('javascript')
<script>
function submeterFormNew() {
var form = document.getElementById('formNew');
form.submit();
}
function submeterFormEdit(id) {
var form = document.getElementById('formEdit' + id);
form.submit();
}
</script>
@endsection
\ No newline at end of file
......@@ -114,8 +114,17 @@ Route::prefix('usuarios')->name('admin.')->group(function(){
Route::prefix('naturezas')->group(function(){
//########### Rotas das naturezas ###############################
Route::get('/', 'AdministradorController@naturezas' )->name('admin.naturezas');
Route::get('/index', 'NaturezaController@index' )->name('natureza.index');
Route::get('/nova', 'NaturezaController@create' )->name('natureza.criar');
Route::post('/salvar', 'NaturezaController@store' )->name('natureza.salvar');
Route::get('/detalhes/{id}', 'NaturezaController@show' )->name('natureza.show');
Route::get('/editar/{id}', 'NaturezaController@edit' )->name('natureza.editar');
Route::get('/atualizar/{id}', 'NaturezaController@update' )->name('natureza.atualizar');
Route::get('/excluir/{id}', 'NaturezaController@destroy' )->name('natureza.deletar');
//########### Rotas das grandes areas ##############################
Route::get('/', 'AdministradorController@naturezas' )->name('admin.naturezas');
Route::get('/grande-area', 'GrandeAreaController@index' )->name('grandearea.index');
Route::get('/grande-area/nova', 'GrandeAreaController@create' )->name('grandearea.criar');
Route::post('/grande-area/salvar', 'GrandeAreaController@store' )->name('grandearea.salvar');
......
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