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
| var price = self.custom_value2(); | |
| if(!price){ | |
| price = self.cost(); | |
| self.custom_value2(price); | |
| } |
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 | |
| // add into AppServiceProvider::register() | |
| Validator::extend('imageable', function ($attribute, $value, $params, $validator) { | |
| try { | |
| ImageManagerStatic::make($value); | |
| return true; | |
| } catch (\Exception $e) { | |
| return false; | |
| } |
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 | |
| /** | |
| * Explode with multiple delimiters | |
| * @param array $delimiters | |
| * @param string $string | |
| * @return array | |
| */ | |
| function explodeX(array $delimiters, string $string ) | |
| { | |
| return explode( chr( 1 ), str_replace( $delimiters, chr( 1 ), $string ) ); |