Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
MissingModelPropertyException
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace DevToolbelt\LaravelEloquentPlus\Exceptions;
6
7/**
8 * Exception thrown when a required model property is missing.
9 *
10 * @package DevToolbelt\LaravelEloquentPlus\Exceptions
11 */
12class MissingModelPropertyException extends LaravelEloquentPlusException
13{
14    /**
15     * Create a new MissingModelPropertyException instance.
16     *
17     * @param string $modelClass The model class name
18     * @param string $propertyName The missing property name
19     */
20    public function __construct(string $modelClass, string $propertyName)
21    {
22        $message = 'The property "%s" is required in model "%s". '
23            . 'Please, add this column in your table and the property in the fillable attribute in your model.';
24
25        parent::__construct(sprintf($message, $propertyName, $modelClass));
26    }
27}