Skip to content

Instantly share code, notes, and snippets.

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

Arthur Monney mckenziearts

🏠
Working from home
View GitHub Profile
@mckenziearts
mckenziearts / livewire-checkout.php
Created March 23, 2024 12:02
A simple example to create Order in Laravel Shopper using Livewire
<?php
namespace App\Http\Livewire\Checkout;
use App\Actions\PlaceOrder as PlaceOrderAction;
use App\Notifications\PlaceOrder;
use Darryldecode\Cart\Facades\CartFacade;
use Livewire\Component;
use Shopper\Framework\Models\Shop\Order\Order;
use Shopper\Framework\Models\Shop\Order\OrderItem;
@mckenziearts
mckenziearts / Setting.php
Last active January 31, 2021 09:15
Livewire example upload file
<?php
use Illuminate\Validation\Rule;
use Livewire\Component;
use Livewire\WithFileUploads;
class Setting extends Component
{
use WithFileUploads;
@mckenziearts
mckenziearts / webpack.mix.example-postcss.js
Created January 15, 2021 08:28
Laravel webpack mix example
const mix = require('laravel-mix');
const path = require('path');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
@mckenziearts
mckenziearts / laravel.js
Created February 24, 2020 17:10 — forked from JeffreyWay/laravel.js
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@mckenziearts
mckenziearts / .eslintrc
Created November 23, 2019 21:25 — forked from 1natsu172/.eslintrc
My airbnb based ESLint config for "typescript-eslint" with React & prettier
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "."
},
"env": {
"browser": true,
"jest/globals": true
},