Skip to content

Instantly share code, notes, and snippets.

@fvanzeijl
fvanzeijl / sequence-order-no.php
Last active June 6, 2023 14:29
Custom Sequence Number Generation for Order
<?php
// Based on code-snipped in laracasts-discussion by bobbybouwmann (https://github.com/bobbybouwmann)
// https://laracasts.com/discuss/channels/general-discussion/custom-sequence-number-generation-for-order?reply=70649
// -----------------------------------------------------------------------------------------------------------------
function getNextOrderNumber()
{
// Get the last created order
$lastOrder = Order::orderBy('created_at', 'desc')->first();
@fvanzeijl
fvanzeijl / app.js
Last active November 10, 2022 13:35
Register npm modules globaly in Alpinejs via alpine.store
// Import modules
import Swiper from 'swiper'
// Import alpine
import Alpine from 'alpinejs'
window.Alpine = Alpine
// Register module in alpines store
Alpine.store('Swiper', Swiper)