Skip to content

Instantly share code, notes, and snippets.

View atomjoy's full-sized avatar

Atomjoy atomjoy

View GitHub Profile
@atomjoy
atomjoy / Locales.vue
Created June 23, 2025 18:36
Vue component locales
<script setup>
// See: https://vue-i18n.intlify.dev/guide/advanced/composition
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n({
// useScope: 'global', // Overwrite global
locale: 'en',
messages: {
en: {
@atomjoy
atomjoy / Queue-Mail-Jobs-Laravel.md
Last active June 21, 2025 08:23
Kolejkowanie wiadomości email w Laravel (queue, jobs, events).

Queue Mail Jobs Laravel

Laravel pozwala na łatwe tworzenie zadań w kolejce, które mogą być przetwarzane w tle. Przenosząc czasochłonne zadania do kolejki, Twoja aplikacja może odpowiadać na żądania internetowe szybciej i zapewniać lepsze wrażenia użytkownika.

Dodaj zadanie do kolejki

@atomjoy
atomjoy / CRON.md
Last active June 14, 2025 16:57
Wysyłanie wiadomości email z cron

Wysyłanie wiadomości email z cron

Połącz się przez ssh.

Plik mail.php

Plik php wysyłający wiadomość email.

<?php
@atomjoy
atomjoy / PaginateCustom.vue
Last active June 11, 2025 16:07
Vue 3 pagination component.
<!-- Runs only with vue 3.5 -->
<!-- <PaginateCustom :current_page="current_page" :last_page="last_page" @page="setPage" /> -->
<script setup>
import { onMounted, watchEffect } from 'vue';
const { current_page, last_page, offset } = defineProps({
current_page: { type: Number, default: 1 },
last_page: { type: Number, default: 10 },
offset: { type: Number, default: 3 },
@atomjoy
atomjoy / Nano-email.html
Last active May 22, 2025 14:08
Nano minimal Gmail html email template.
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Welcome</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet" />
@atomjoy
atomjoy / Laravel_app_composer.json
Last active May 22, 2025 14:02
Laravel package development on localhost.
{
"require": {
"php": "^8.2",
"laravel/framework": "^12.0",
"atomjoy/payu": "dev-main"
},
"repositories": [
{
"type": "path",
"url": "packages/atomjoy/payu"
@atomjoy
atomjoy / Laravel-Custom-Json-Exception.md
Last active May 4, 2025 09:14
Laravel 12 custom json exception class.

Custom Json Exception in Laravel

Laravel 12 custom json exception class.

JsonException Class

<?php

namespace App\Exceptions;
@atomjoy
atomjoy / Laravel-Custom-Exception-Handler.md
Created May 4, 2025 09:03
Laravel custom exception handler with service provider (modules).

Laravel 12 Custom Exception Handler

Laravel 12 custom exception handler with service provider (modules).

ExceptionHandlerProvider.php

<?php

namespace App\Providers;
@atomjoy
atomjoy / Change-Laravel-Public-Directory.md
Last active April 29, 2025 09:28
How to run Laravel application from public_html directory on shared hosting or xampp.

Change Laravel public directory

How to run Laravel application from public_html directory on shared hosting or xampp.

Cmd project

cd /
mkdir www
cd www
@atomjoy
atomjoy / Laravel-Multiple-Guards.md
Last active April 29, 2025 09:29
How to run multi guard authentication in Laravel application.

Laravel multiple guards

How to run multi guard authentication in Laravel application.

Cmd project

cd /
mkdir www
cd www