Skip to content

Instantly share code, notes, and snippets.

View coolsam726's full-sized avatar

Sam Maosa coolsam726

View GitHub Profile
@coolsam726
coolsam726 / app.js
Created August 21, 2023 07:17 — forked from saineshmamgain/app.js
Setting up laravel-websockets on production server using nginx proxy with letsencrypt ssl
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
wsHost: window.location.host,
wsPort: 80,
wssPort: 443,
disableStats: true,
enabledTransports: ['ws', 'wss'],
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
});
@coolsam726
coolsam726 / PrimeDatatables.vue
Last active May 10, 2024 08:28
A fully functional Vue component to work with savannabits/primevue-datatables package (Works with tailwindcss and Vue.js 3.x). NB: The usage example is based on savannabits/acacia, a backend generator I developed to make your life easier by generating code for the backend CRUDs. You can flesh out the unnecessary parts to remain with the bare-bon…
<template>
<DataTable
class="p-datatable-sm"
:value="records"
:lazy="true"
:auto-layout="true"
:paginator="true"
:rows="10"
v-model:filters="filters"
ref="dt"
@coolsam726
coolsam726 / CountriesSeeder.php
Created December 8, 2021 13:04
The World's Countries Laravel Seeder
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class CountriesTableSeeder extends Seeder
{
/**
* Run the database seeds.
@coolsam726
coolsam726 / CountiesSeeder.php
Created December 8, 2021 13:02
Kenya Counties Laravel Seeder
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class CountiesSeeder extends Seeder
{
/**
* Run the database seeds.
@coolsam726
coolsam726 / 2021_05_04_093648_create_blocked_email_domains_table.php
Created May 4, 2021 10:37
Laravel 8 and PHP 8.0 Migration and Seeder for 8k+ Free Email Provider Domains (In case you want to block non-corporate email domains)
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBlockedEmailDomainsTable extends Migration
{
/**
* Run the migrations.