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
public function boot() | |
{ | |
Validator::extend('price', function($attribute, $value, $parameters, $validator) { | |
return preg_match ('^\d{0,8}(\.\d{1,4})?$', $value); | |
}); | |
} |
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
"autoload": { | |
"psr-4": { | |
"App\\": "app/", | |
"MyName\\MyPackage\\": "src" | |
} | |
} |
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
trait ExpiredPosting { | |
/** | |
* Boot the soft deleting trait for a model. | |
* | |
* @return void | |
*/ | |
public static function bootExpiredPosting() | |
{ | |
static::addGlobalScope(new ExpiredPostingScope); | |
} |
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 | |
$id = 'gender'; | |
$name = $id; | |
$value = set_value($name, $item[$name]); | |
?> | |
<label for="<?php echo $id; ?>"> | |
<select> | |
<option value="Male">Male</option> | |
<option value="Female">Female</option> | |
</select> |
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
public function nameChange($img){ | |
$img = 'user1-128x128.jpg'; | |
$file = basename($img); | |
$fileDir = '../resources/secure/'; | |
if (file_exists($fileDir . $file)){ | |
$file = $fileDir . $file; | |
$image = imagecreatefromjpeg ( $file ); |
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
// TypeScript | |
import {Component, View, bootstrap, For} from 'angular2/angular2'; | |
@Component({ | |
selector: 'display', | |
}) | |
@View({ | |
template: | |
'<p>My name: {{ myName }}</p> ' + |
NewerOlder