Skip to content

Instantly share code, notes, and snippets.

View NandoKstroNet's full-sized avatar
🎯
Focusing

Nando Kstro Net NandoKstroNet

🎯
Focusing
View GitHub Profile
@NandoKstroNet
NandoKstroNet / CategoryRequest.php
Created December 6, 2019 20:59
Category Request curso Laravel 6 Criando um Marketplace em http://codeexperts.com.br
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CategoryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@NandoKstroNet
NandoKstroNet / create.blade.php
Created December 6, 2019 21:00
Tela de criação de categorias curso Laravel 6 Criando um Marketplace em http://codeexperts.com.br
@extends('layouts.app')
@section('content')
<h1>Criar Categoria</h1>
<form action="{{route('admin.categories.store')}}" method="post">
<input type="hidden" name="_token" value="{{csrf_token()}}">
<div class="form-group">
<label>Nome</label>
<input type="text" name="name" class="form-control @error('name') is-invalid @enderror" value="{{old('name')}}">
@NandoKstroNet
NandoKstroNet / front.blade.php
Last active December 19, 2019 18:57
Template marketplace do curso Laravel 6 na Prática - Criando um Markeplace da http://codeexperts.com.br
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Marketplace L6</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
@NandoKstroNet
NandoKstroNet / drawInstallmentsPagSeguro.js
Created December 27, 2019 19:32
Código para o curso Laravel 6 na Prática - Criando um Marketplace em http://codeexperts.com.br
function drawSelectInstallments(installments) {
let select = '<label>Opções de Parcelamento:</label>';
select += '<select class="form-control">';
for(let l of installments) {
select += `<option value="${l.quantity}|${l.installmentAmount}">${l.quantity}x de ${l.installmentAmount} - Total fica ${l.totalAmount}</option>`;
}
@NandoKstroNet
NandoKstroNet / postgres-cheatsheet.md
Created April 7, 2020 21:33 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
Mutation:
type: object
config:
fields:
createProduct:
type: "Product"
resolve: "@=mutation('create_product', [args])"
args:
input:
type: "ProductInput"
@NandoKstroNet
NandoKstroNet / ProductMutation.php
Created April 12, 2020 22:26
Série sobre GraphQL com Symfony 4 do canal da Code Experts no Youtube (http://youtube.com/CodeExpertsLearning)
<?php
namespace App\GraphQL\Mutation;
use Doctrine\ORM\EntityManager;
use OverBlog\GraphQLBundle\Definition\Argument;
use Overblog\GraphQLBundle\Definition\Resolver\AliasedInterface;
use Overblog\GraphQLBundle\Definition\Resolver\MutationInterface;
use App\Entity\Product;
class ProductMutation implements MutationInterface, AliasedInterface
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UserRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@NandoKstroNet
NandoKstroNet / pagseguro_functions.js
Created June 16, 2020 18:33
Trecho para tradução das mensagens das validações do PagSeguro Checkout transparente. http://codeexperts.com.br
function errorsMapPagseguroJS(code)
{
switch(code) {
case "10000":
return 'Bandeira do cartão inválida!';
break;
case "10001":
return 'Número do Cartão com tamanho inválido!';
break;
<div class="form-group">
<label>Fotos do Produto</label>
<input type="file" name="photos[]" class="form-control @error('photos.*') is-invalid @enderror" multiple>
@error('photos.*')
<div class="invalid-feedback">
{‌{$message}}
</div>
@enderror
</div>