Skip to content

Instantly share code, notes, and snippets.

View gist:8537274

My Validation Base Class

I was asked how I deal with validation / create and update validation rulesets. Well here is one method I have used. Don't be afraid to build on top of what the framework has already given you. In my projects I use a base class for almost anything. You never know when you want your classes to inherit some common functionality. My BaseValidator actually has some pretty useful methods and properties in it.

<?php

namespace FooProject\Internal\Validators;

use FooProject\Internal\Sanitizers\BaseSanitizer;
@akuzemchak
akuzemchak / l4project.sh
Last active Dec 6, 2020
New L4 project with clean history
View l4project.sh
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
@niallobrien
niallobrien / gist:5098578
Last active Jan 12, 2016
Laravel 4 install & update process
View gist:5098578
// Clone L4 repo
git clone -b develop git://github.com/laravel/laravel.git myapp
cd myapp
// Install Composer
curl -sS https://getcomposer.org/installer | php
php composer.phar install
// Rename origin
git remote rename origin upstream
@ziadoz
ziadoz / awesome-php.md
Last active Jul 19, 2021
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md