Skip to content

Instantly share code, notes, and snippets.

View atomjoy's full-sized avatar

Atomjoy atomjoy

View GitHub Profile
@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
@atomjoy
atomjoy / Laravel-Spatie-Permissions.md
Last active April 29, 2025 11:49
Laravel Spatie Permissions

Laravel Spatie Permissions

How to run multi guard authentication with permissions in Laravel application.

Cmd project

cd /
mkdir www
cd www
@atomjoy
atomjoy / Ftp-Storage-Image-Upload-Laravel.md
Created March 28, 2025 12:56
Laravel FTP Storage image upload.
@atomjoy
atomjoy / Paginate-Laravel.md
Created March 28, 2025 12:23
How to paginate models in Laravel application.

Laravel Paginate

Pagination is a technique used to divide a large dataset into smaller pages.

Paginate

<?php

use App\Models\User;