Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class NovelList extends Illuminate\Support\Collection
- {
- public function __construct($items = [])
- {
- $not_allow_items = array_filter($this->getArrayableItems($items), function ($item){
- return !($item === null || $item instanceof Novel);
- });
- if (!empty($not_allow_items)) {
- throw new InvalidArgumentException('NovelList required only array of nullable Novel.');
- }
- parent::__construct($items);
- }
- }
Add Comment
Please, Sign In to add comment