This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"post-root-package-install": [ | |
"php -r \"copy('.env.example', '.env');\"", | |
"php -r \"chmod('./vendor/copam/phpjasper/src/JasperStarter/bin/jasperstarter', 0755);\"", | |
"php -r \"chmod('./storage', 0777);\"" | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = DB::table('cliente AS c') | |
->join('cidade AS m', 'm.id_cidade', '=', 'c.id_cidade') | |
->join('estado AS e', 'e.id_estado', '=', 'm.id_estado') | |
->whereExists(function ($query) use ($id_produto) { | |
$query->select(DB::raw(1)) | |
->from('cliente_produto AS cp') | |
->whereRaw('cp.id_cliente = c.id_cliente') | |
->where('c.status', 'A') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Pagamento; | |
use App\Empresa; | |
use App\Destino; | |
use Illuminate\Http\Request; | |
use DB; | |
use Validator; | |
use Illuminate\Validation\Rule; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class EnableCors | |
{ | |
/** | |
* Handle an incoming request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function update($request, $id) | |
{ | |
$data = $request->all(); | |
$validator = Validator::make($data, [ | |
'first_name' => 'sometimes|required', | |
'last_name' => 'sometimes|required', | |
'email' => [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Validator; | |
public function update(Request $request, $id) | |
{ | |
$validator = Validator::make($request->all(), [ | |
'name' => 'sometimes|required', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function authJWT($request) | |
{ | |
//dados de entrada | |
$usuario = $request->input('login'); | |
$senhaAntiga = md5($request->input('senha')); | |
$senhaString = $request->input('senha'); | |
/* | |
|lógica de atualização de senha | |
|caso o usuario possua uma senha MD5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$i = 0; | |
do { | |
echo $i; | |
} while ($i > 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = array("a" => "maçã", "b" => "banana"); | |
$b = array("a" =>"pêra", "b" => "framboesa", "c" => "morango"); | |
$c = $a + $b; // Uniao de $a e $b | |
echo "União de \$a e \$b: \n"; | |
var_dump($c); | |
$c = $b + $a; // União de $b e $a | |
echo "União de \$b e \$a: \n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// considere os valores a esquerda sendo $a e os valores a direita $b | |
echo 1 == 1; | |
echo 1 != 2; | |
echo 1 <> 2; | |
echo 1 === 1; | |
echo 1 !== 2; | |
echo 2 > 1; |