Skip to content

Instantly share code, notes, and snippets.

View Otisz's full-sized avatar

Otta Levente Otisz

View GitHub Profile
@Otisz
Otisz / 01_readme.md
Last active May 4, 2023 12:19
Laravel's validation outside of Laravel

How to use Laravel's validation outside of Laravel

Based on this SO question here is my implementation.

What is the difference?

The solutions in the SO question does not use custuom validation rules.

The custom Rule is calling the global trans() function. This is why it is in the helpers.php and registered via Composer.
This trans() function is also used to create the validator factory.

@Otisz
Otisz / #next-steps.sh
Last active May 18, 2021 08:05
Setup NextJS + TS + ESLint + Prettier
# 1. Create Next JS app:
yarn create next-app <folder-name>
# 2. CD into <folder-name>
# 3. Create tsconfig.json, .eslintrc and .prettierrc files
touch tsconfig.json .eslintrc .prettierrc
# 4. Install dev depencies via Yarn
yarn add -D @types/node @types/react @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-eslint eslint eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-simple-import-sort prettier typescript
<?php
/**
* Developed by Levente Otta <leventeotta@gmail.com>
*
* @author Levente Otta <leventeotta@gmail.com>
* @copyright Copyright (c) 2019. Levente Otta
*/
namespace App\Models\Traits;