First you need to install illuminate/validation
by typing this composer require illuminate/validation:5.1.*
.
Then, you can use laravel validation like this:
$validatorFactory = new ValidatorFactory;
<?php | |
public function __sleep() | |
{ | |
$ref = new \ReflectionClass(__CLASS__); | |
$props = $ref->getProperties(\ReflectionProperty::IS_PROTECTED); | |
$serialize_fields = array(); | |
foreach ($props as $prop) { |
<script type="text/javascript" charset="utf-8"> | |
//Capitalize first letter while typing in side of input field | |
jQuery(document).ready(function($) { | |
$('#selector').keyup(function(event) { | |
var textBox = event.target; | |
var start = textBox.selectionStart; | |
var end = textBox.selectionEnd; | |
textBox.value = textBox.value.charAt(0).toUpperCase() + textBox.value.slice(1); | |
textBox.setSelectionRange(start, end); | |
}); |
<?php | |
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> | |
* @copyright Copyright 2012 Sean Murphy. All rights reserved. |
var LatLngList = new Array (new google.maps.LatLng (52.537,-2.061), new google.maps.LatLng (52.564,-2.017)); | |
// Create a new viewpoint bound | |
var bounds = new google.maps.LatLngBounds (); | |
// Go through each... | |
for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) { | |
// And increase the bounds to take this point | |
bounds.extend (LatLngList[i]); | |
} | |
// Fit these bounds to the map | |
map.fitBounds (bounds); |
<?php | |
class Torrent | |
{ | |
public function scrape(array $announce = [ ] , $hash_info = null) | |
{ | |
$r = [ | |
'seeders' => 0 , | |
'leechers' => 0 |
<?php | |
class BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |
DELIMITER $$ | |
CREATE FUNCTION `haversine` (lat1 DECIMAL(8,6), lng1 DECIMAL(8,6), lat2 DECIMAL(8,6), lng2 DECIMAL(8,6)) RETURNS DECIMAL(8,6) | |
BEGIN | |
DECLARE R INT; | |
DECLARE dLat DECIMAL(30,15); | |
DECLARE dLng DECIMAL(30,15); | |
DECLARE a1 DECIMAL(30,15); | |
DECLARE a2 DECIMAL(30,15); | |
DECLARE a DECIMAL(30,15); | |
DECLARE c DECIMAL(30,15); |
Copyright (C) 2016 Donnie Ray Jones | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Register The Laravel Class Loader | |
|-------------------------------------------------------------------------- | |
| | |
| In addition to using Composer, you may use the Laravel class loader to | |
| load your controllers and models. This is useful for keeping all of | |
| your classes in the "global" namespace without Composer updating. |