Require this project in your composer.json file
"sensiolabs/security-checker": "dev-master"
Add the following line to app/start/artisan.php:
| <?php namespace Initr\Services; | |
| use Illuminate\Validation\Factory as LaravelValidator; | |
| abstract class Validator | |
| { | |
| protected $validator; | |
| protected $data = array(); |
| <?php | |
| use Illuminate\Support\Contracts\ArrayableInterface; | |
| use Illuminate\Support\Contracts\JsonableInterface; | |
| class Excel implements ArrayableInterface, JsonableInterface{ | |
| protected $objPHPExcel; | |
| public function __construct($file){ | |
| if($file instanceof \SplFileInfo){ | |
| $filename = $file->getRealPath(); |
| ini_set("memory_limit","200M"); | |
| if( !empty($_SERVER['HTTP_ORIGIN']) ){ | |
| // Enable CORS | |
| header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); | |
| header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); | |
| header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Range, Content-Disposition, Content-Type'); | |
| } | |
| if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ){ |
| #!/bin/bash | |
| echo "Generating an SSL private key to sign your certificate..." | |
| openssl genrsa -des3 -out myssl.key 1024 | |
| echo "Generating a Certificate Signing Request..." | |
| openssl req -new -key myssl.key -out myssl.csr | |
| echo "Removing passphrase from key (for nginx)..." | |
| cp myssl.key myssl.key.org | |
| openssl rsa -in myssl.key.org -out myssl.key |
My projects (tutorials are on my blog at http://maxoffsky.com):
| { | |
| "name": "laravel/laravel", | |
| "description": "The Laravel Framework.", | |
| "keywords": ["framework", "laravel"], | |
| "license": "MIT", | |
| "require": { | |
| "laravel/framework": "4.1.*", | |
| "way/generators": "dev-master", | |
| "cartalyst/sentry": "2.0.*", | |
| "jasonlewis/basset": "dev-master", |
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;| { | |
| "jsdocs_align_tags": "no", | |
| "jsdocs_param_description": false, | |
| "jsdocs_return_description": false, | |
| "jsdocs_spacer_between_sections": true | |
| } |
| # Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt" | |
| # Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png | |
| # A big thanks to \amethyst on Freenode | |
| if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color | |
| elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color | |
| fi | |
| if tput setaf 1 &> /dev/null; then | |
| tput sgr0 |