<?php namespace App\Http\Requests;

use App\Http\Requests\Request;
use App\Contact;
use App\Business;
use Session;
use Input;

class ContactFormRequest extends Request {

	/**
	 * Determine if the user is authorized to make this request.
	 *
	 * @return bool
	 */
	public function authorize()
	{
		# $business = Business::findOrFail( $this->business );

		if (! \Auth::user()->isOwner($this->business) ) return false;

		return $this->contact === null || $this->contact->isSuscribedTo($this->business);
	}

	/**
	 * Get the validation rules that apply to the request.
	 *
	 * @return array
	 */
	public function rules()
	{
		$rules = [	'firstname' => 'required|min:3',
					'lastname' => 'required|min:3',
					'gender' => 'required|max:1',
					'mobile' => 'phone',
					'mobile_country' => 'required_with:mobile|max:2' /* FIXME: LENGHT MUST BE EXACT 2 */
				];

		switch ($this->method())
		{
			case 'PATCH':
			case 'PUT':
			case 'POST':
				return $rules;
				break;			
			default:
				return [];
				break;
		}
	}
}

<?php namespace App\Http\Requests;

use App\Http\Requests\Request;
use App\Contact;
use App\Business;
use Session;
use Input;

class ContactFormRequest extends Request {

	/**
	 * Determine if the user is authorized to make this request.
	 *
	 * @return bool
	 */
	public function authorize()
	{
		if (! \Auth::user()->isOwner($this->business) ) return false;

		return $this->contact === null || $this->contact->isSuscribedTo($this->business);
	}

	/**
	 * Get the validation rules that apply to the request.
	 *
	 * @return array
	 */
	public function rules()
	{
		$rules = [	'firstname' => 'required|min:3',
					'lastname' => 'required|min:3',
					'gender' => 'required|max:1',
					'mobile' => 'phone',
					'mobile_country' => 'required_with:mobile|size:2' /* FIXME: LENGHT MUST BE EXACT 2 */
				];

		switch ($this->method())
		{
			case 'PATCH':
			case 'PUT':
			case 'POST':
				return $rules;
				break;			
			default:
				return [];
				break;
		}
	}
}

Fix country ISO code (2) validation rule to match exactly 2 chars long
Fix country ISO code (2) validation rule to match exactly 2 chars long
