ActiveRecord\ReadOnlyException::__construct PHP Method

__construct() public method

Sets the exception message to show the undefined property's name.
public __construct ( str $class_name, str $method_name ) : void
$class_name str name of the model that is read only
$method_name str name of method which attempted to modify the model
return void
    public function __construct($class_name, $method_name)
    {
        $this->message = "{$class_name}::{$method_name}() cannot be invoked because this model is set to read only";
        parent::__construct();
    }
ReadOnlyException