Skip to content

Instantly share code, notes, and snippets.

View blockpc's full-sized avatar
🏠
Working from home

blockpc blockpc

🏠
Working from home
View GitHub Profile
@blockpc
blockpc / select2-single.md
Last active May 10, 2024 17:15
select2 single for livewire 3 with tailwind and alpine

Select2 Livewire

Crear un componente select2.blade.php

@props(['name', 'title', 'options', 'empty_values' => 'Sin registros encontrados', 'selected_name' => null, 'selected_id' => null])

<div {{ $attributes->only('class')->merge(['class' => 'flex flex-col text-xs font-semibold']) }}>
    <label class="w-full lg:w-1/3 block font-medium text-xs md:text-sm" for="{{ $name }}">{{ title(__($title)) }}</label>
    <div class="w-full">
@blockpc
blockpc / DevelopmentAccess.php
Last active July 2, 2022 15:30
Middleware for development
<?php
declare(strict_types=1);
namespace App\Http\Middleware;
use Closure;
final class DevelopmentAccess
{
@blockpc
blockpc / color.blade.php
Last active May 10, 2024 17:09
Component color-picker for laravel TALL
// - si el componente lleva el parametro 'hexadecimal' los colores seran formateados como valores hexadecimales '#c62828'
// - si el componente no lleva el parametro 'hexadecimal' los colores seran formateados como valores string siguiendo el formato tailwind 'bg-red-800'
@props(['hexadecimal' => false])
<div>
<div class="bg-white mx-auto my-auto">
<div x-data="app()" x-init="[initColor()]">
<div>
<div class="flex flex-row relative">
@blockpc
blockpc / communes.json
Last active October 5, 2021 13:35
Comunas de Chile. Formato JSON
[
{"id": 1101, "name": "Iquique", "province_id": 11},
{"id": 1107, "name": "Alto Hospicio", "province_id": 11},
{"id": 1401, "name": "Pozo Almonte", "province_id": 14},
{"id": 1402, "name": "Camiña", "province_id": 14},
{"id": 1403, "name": "Colchane", "province_id": 14},
{"id": 1404, "name": "Huara", "province_id": 14},
{"id": 1405, "name": "Pica", "province_id": 14},
{"id": 2101, "name": "Antofagasta", "province_id": 21},
{"id": 2102, "name": "Mejillones", "province_id": 21},
@blockpc
blockpc / provinces.json
Last active October 5, 2021 13:35
Provincias de Chile. Formato JSON
[
{"id":11, "name": "Iquique", "region_id": 1},
{"id":14, "name": "Tamarugal", "region_id": 1},
{"id":21, "name": "Antofagasta", "region_id": 2},
{"id":22, "name": "El Loa", "region_id": 2},
{"id":23, "name": "Tocopilla", "region_id": 2},
{"id":31, "name": "Copiapó", "region_id": 3},
{"id":32, "name": "Chañaral", "region_id": 3},
{"id":33, "name": "Huasco", "region_id": 3},
{"id":41, "name": "Elqui", "region_id": 4},
@blockpc
blockpc / regions.json
Last active October 5, 2021 13:37
Regiones de Chile. Formato JSON
[
{"id":1, "name": "Tarapacá"},
{"id":2, "name": "Antofagasta"},
{"id":3, "name": "Atacama"},
{"id":4, "name": "Coquimbo"},
{"id":5, "name": "Valparaíso"},
{"id":6, "name": "Libertador Gral. Bernardo O'Higgins"},
{"id":7, "name": "Maule"},
{"id":8, "name": "Biobío"},
{"id":9, "name": "Araucanía"},