Skip to content

Instantly share code, notes, and snippets.

<?php
function incrementChar(string $start = 'A', string $end = 'Z')
{
$chars = [];
for ($i = $start; $i !== $end; $i++)
{
$chars[] = $i;
}
$chars[] = $end;
@binaryweavers
binaryweavers / AnyLivewireComponent.php
Last active April 22, 2021 06:54
Fluent toaster(alerts) for laravel/livewire using alpinejs and tailwindcss
public function showToasters(){
// default info toaster with timeout
$this->toaster('your message');
// makes it persistent
$this->toaster('your message')->persistent();
// warning toaster with timeout
$this->toaster('your message')->warning();
@binaryweavers
binaryweavers / webpack.mix.js
Created April 20, 2020 12:22 — forked from julienbourdeau/webpack.mix.js
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')({