Skip to content

Instantly share code, notes, and snippets.

View ClaudioHenrique's full-sized avatar
🏠
CTO Fortuna Pay @ Working from home

Cláudio Henrique ClaudioHenrique

🏠
CTO Fortuna Pay @ Working from home
View GitHub Profile
/* Middleware JWTAuthNew - Verifica todos os requisitos de autenticação antes de permitir que a rota deseja executada */
Route::group(array('middleware' => 'jwt.auth.new'), function(){
});
<?php
namespace App\Http\Middleware;
use Closure;
use Tymon\JWTAuth\Exceptions\JWTException;
use Tymon\JWTAuth\Exceptions\TokenExpiredException;
use Tymon\JWTAuth\Middleware\BaseMiddleware;
use JWTAuth;
class JWTAuthNew extends BaseMiddleware
{
@foreach($veiculos as $veiculo)
<tr>
<td>VEICULO PROPRIETÁRIO?</td>
<td></td>
</tr>
@endforeach
{
"tipo_carroceria": [
{
"id": "1",
"tipo": "Carroceria 01"
},
{
"id": "2",
"tipo": "Carroceria 02"
}
<?php
$nome = $_POST['nome'];
$idade = $_POST['idade'];
$data = array(
'nome' => $nome,
'idade' => $idade
);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int read_line(FILE *in, char *buffer, size_t max)
{
return fgets(buffer, max, in) == buffer;
}
void cadastrarVendedor(){
{
"cardapio": {
"Promocoes": [
{
"id_produto": "1625",
"nome": "Atum",
"ingredientes": null,
"precos": "20",
"validade_promocao": [
"segunda",
@ClaudioHenrique
ClaudioHenrique / consulta
Created January 2, 2015 23:19
Consulta ao Banco.
function search($id){
$sql = "SELECT id,value,type FROM mt_type WHERE fk_questao = :id";
try{
$db = getConnection();
$stmt = $db->prepare($sql);
$stmt->bindParam('id',$id);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
}catch(PDOException $e){
echo $e->getMessage();
@ClaudioHenrique
ClaudioHenrique / consulta
Created January 2, 2015 23:19
Consulta ao Banco.
function search($id){
$sql = "SELECT id,value,type FROM mt_type WHERE fk_questao = :id";
try{
$db = getConnection();
$stmt = $db->prepare($sql);
$stmt->bindParam('id',$id);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
}catch(PDOException $e){
echo $e->getMessage();
function getConnection() {
$dbhost="localhost";
$dbuser="root";
$dbpass="root";
$dbname="db_name";
$dbh = new PDO("mysql:host=$dbhost;dbname=$dbname;", $dbuser, $dbpass);
$dbh -> exec("set names utf8");
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $dbh;
}