Skip to content

Instantly share code, notes, and snippets.

View milanchheda's full-sized avatar
🎯
Focusing

Milan Chheda milanchheda

🎯
Focusing
View GitHub Profile
@skadimoolam
skadimoolam / checkbox.blade.php
Last active February 8, 2020 17:03
Customizable form partials for Laravel - https://laravelcollections.com
@php
$d = $d ?? null; // default value
@endphp
<div class="form-group row">
<label for="{{ $n }}" class="col-sm-4 col-form-label text-md-right"><b>{{ $l }}</b></label>
<div class="col-md-8">
<input id="{{ $n }}" type="checkbox" class="form-control" name="{{ $n }}" value="1" @if(old($n, $d) == '1') checked @endif>
@if ($errors->has($n))
<small class="text-danger">{{ $errors->first($n) }}</small>
@sanampatel
sanampatel / laravel_deploy.txt
Last active February 27, 2024 09:52
Laravel Deploy Script after git pull
# GIT MERGE OPTIONS DEPENDING HOSTING OR DEPLOYMENT PROVIDERS
# git checkout -- .
# git checkout .
# git merge
# php artisan down || true
# Put the application into maintenance / demo mode
php artisan down
# GIT Clear current generated files so can pull new ones
@julienbourdeau
julienbourdeau / webpack.mix.js
Created April 20, 2020 06:43
Laravel Mix with multiple Tailwind config and PurgeCSS (separate Admin dashboard and Front app)
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
const rootPath = Mix.paths.root.bind(Mix.paths);
const tailwindPlugins = function(configFile, paths) {
const pluginList = [tailwindcss(configFile)];
if (mix.inProduction()) {
pluginList.push(require('@fullhuman/postcss-purgecss')({
@x7ryan
x7ryan / ExampleUsage.php
Last active July 29, 2023 00:03
A simple Laravel Livewire trait to include rules and messages from a Laravel FormRequest Class. Simply use this trait and define a protected property useFormRequest as a reference to the FormRequest class you wish to use. This can be used to share validation logic between livewire components and traditonal Laravel controllers, for example when u…
<?php
namespace App\Http\Livewire;
use Livewire\Component;
use App\Http\Livewire\Concerns\FormRequest;
class ExampleUsage extends Component
{
use FormRequest;