| Total Complexity | 5 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class QuickCategory extends Component |
||
| 10 | { |
||
| 11 | public $model; |
||
| 12 | public $category_id; |
||
| 13 | public $name; |
||
| 14 | public $categoryid; |
||
| 15 | |||
| 16 | protected $rules = [ |
||
| 17 | 'name' => 'required|max:255', |
||
| 18 | ]; |
||
| 19 | |||
| 20 | public function mount($model, $category_id = null) |
||
| 21 | { |
||
| 22 | $this->model = $model; |
||
| 23 | $this->category_id = $category_id; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function submit() |
||
| 27 | { |
||
| 28 | $category = Category::create([ |
||
| 29 | 'code' => rand(100000, 999999), |
||
| 30 | 'model' => $this->model, |
||
| 31 | 'name' => $this->name, |
||
| 32 | 'category_id' => $this->categoryid ? ($this->categoryid != '' ? $this->categoryid : null) : null, |
||
| 33 | 'slug' => SlugService::createSlug(Category::class, 'slug', $this->name), |
||
| 34 | ]); |
||
| 35 | |||
| 36 | $this->category_id = $category->id; |
||
| 37 | |||
| 38 | $this->emit('quick_category_created'); |
||
| 39 | } |
||
| 40 | public function render() |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths