Skip to content

Instantly share code, notes, and snippets.

View davidbirkin's full-sized avatar

David Birkin davidbirkin

View GitHub Profile
<div class="w-full bg-[#8CBDB9] flex items-center justify-between px-4 py-1 shadow">
<div class="flex items-center">
<img src="{{ asset('images/flashycardz-logo-new.png') }}" alt="FlashyCardz Logo"
class="w-24">
{{-- <span class="text-xs italic text-center hidden md:block">Custom Flashcards<br/>Made Easy</span>--}}
</div>
<div class="flex space-x-4">
@if (Route::is('welcome') || Route::is('quiz.show'))
<a class="text-[#2D3E4E] hover:text-black-700" href="/">Home</a>
@endif
<?php
namespace App\Jobs\Webhooks;
use App\Models\License;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
private function sendWebhook( License $license )
{
$webhook = $license->webhook->url;
$payload = json_encode([
'license' => $license->key,
'expires_at' => $license->expires_at,
'customer' => $license->customer,
], JSON_THROW_ON_ERROR);
$hash = hash_hmac('sha256', $payload, $license->webhook->secret);
<?php
$size = "10";
public function getData($size)
{
return match($size) {
"10" => ["group" => "A", "points" => 4.5],
"11" => ["group" => "A", "points" => 4.5],
"12" => ["group" => "A", "points" => 4.5],
<?php
namespace App\Livewire\Company;
use App\Models\Company;
use Livewire\Component;
class UpdateBaseCompanyDetails extends Component
{
public Company $company;
<section>
<header>
<h2 class="text-lg font-medium text-gray-900">
{{ __('Company Profile Information') }}
</h2>
</header>
<form wire:submit="save" method="post" action="{{ route('company.update.basic') }}" class="mt-6 w-full"
enctype="multipart/form-data">
@csrf
<!-- Route -->
Route::get('/test', function () {
$options = [
'' => 'Select',
'active' => 'Active',
'ended' => 'End'
];
return view('test')->with([
'options' => $options
@davidbirkin
davidbirkin / app.js
Created November 2, 2022 22:52
Example of Laravel App.js Multi Template
import { createInertiaApp, Head, Link } from "@inertiajs/inertia-vue3";
import { InertiaProgress } from "@inertiajs/progress";
import { createApp, h } from "vue";
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
/**
* Import Layouts to be used in the SaaS
*/
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout.vue"
import GuestLayout from "@/Layouts/GuestLayout.vue";