Skip to content

Instantly share code, notes, and snippets.

View raank's full-sized avatar

Felipe Rank raank

  • Self-Employeer
  • SC - BR
View GitHub Profile
@raank
raank / install-pre-commit.sh
Last active September 2, 2021 21:33
Instalador do Pre-Commit
#!/bin/bash
##########
# PHP STAN
##########
curl -OL https://github.com/phpstan/phpstan/releases/download/0.12.98/phpstan.phar
sudo chmod a+x phpstan.phar
sudo mv phpstan.phar /usr/local/bin/phpstan
##########
<?php
namespace App\Models;
/**
* @OA\Schema(
* schema="User",
* type="object",
* description="Schema of Model User",
* @OA\Property(
<?php
namespace App\Models;
class User extends \Framework\Package\Model
{
/**
* The identification of this resource.
*
* @var integer
<?php
require_once __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Instance Environment Variables.
|--------------------------------------------------------------------------
*/
<?php
namespace Modules\Users\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Modules\Users\Entities\User;
use Modules\Users\Http\Requests\UsersRequest;
use Ramsey\Uuid\Uuid;
<?php
class Controller
{
public function index()
{
return view('home', [
'seguidores' => [
'instagram' => ''// query para inseriros seguidores do instagram
'facebook' => ''// query para inseriros seguidores do facebook
]
<?php
foreach ($request->redesSociais as $redes) {
foreach ($redes as $key => $value) {
// para tratar os dados de cada rede
// aqui exibe campo por campo, seria para um tratamento de dados
}
// para salvar não é necessario fazer outro foreach, apenas o primeiro com as redes
$redes = new RedesSociais();
$redes->tipo_redes_id = 1; //Coloquei Manual só pra teste
<?php
class Controller
{
public function store(Request $request)
{
dd($request->redesSociais); // dumping
foreach ($request->redesSociais as $index => $rede) {
// $index = 0, 1, 2
FROM phpdockerio/php73-fpm:latest
WORKDIR "/application"
# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install php7.3-mysql php-redis php7.3-sqlite3 \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
FROM phpdockerio/php73-fpm:latest
WORKDIR "/application"
# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install php7.3-mysql php-redis php7.3-sqlite3 \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*