This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Extentions; | |
use DB; | |
use Log; | |
use Illuminate\Validation\Validator; | |
class CustomValidation extends Validator { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pw_add_image_sizes() { | |
add_image_size( 'pw-thumb', 300, 100, true ); | |
add_image_size( 'pw-large', 600, 300, true ); | |
} | |
add_action( 'init', 'pw_add_image_sizes' ); | |
function pw_show_image_sizes($sizes) { | |
$sizes['pw-thumb'] = __( 'Custom Thumb', 'pippin' ); | |
$sizes['pw-large'] = __( 'Custom Large', 'pippin' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!file_exists('path/to/directory')) { | |
mkdir('path/to/directory', 0777, true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function createDateRangeArray($strDateFrom,$strDateTo) | |
{ | |
// takes two dates formatted as YYYY-MM-DD and creates an | |
// inclusive array of the dates between the from and to dates. | |
// could test validity of dates here but I'm already doing | |
// that in the main script | |
$aryRange=array(); |
NewerOlder