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
| Terminal | |
| если нужно найти недавно выполненную команду в истории, но помните только часть | |
| `history | grep console` где `console` искомое слово, | |
| выведет нумерованный список команд, находите нужную и запускаете ее по номеру `!541` | |
| Symfony Console | |
| если кому лень настраивать автокомплит команд для симфони, можно просто не писать полные команды, например | |
| `bin/console c:c` равносильно `bin/console cache:clear`, | |
| а `bin/console d:d:c` равносильно `bin/console doctrine:database:create`, |
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
| class Cupon extends Model | |
| { | |
| /** | |
| * Получить продукт где купон id связан. | |
| */ | |
| public function product() | |
| { | |
| return $this->belongsTo('App\Product'); | |
| } | |
| } |
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
| 'phone_number' => "required|unique:users,phone_number,$id|min:10|max:20", | |
| protected function prepareForValidation() | |
| { | |
| $this->offsetSet('phone_number', PhoneHelper::normalize($this->phone_number)); | |
| } | |
| <?php |
OlderNewer