Object is instanciated and inserted into the database.
Created a new Model (GeoRequestModel) with an unrelated name to the container (Demo) - which led to an issue during the creation of new instances:
"message": "Class App\\Containers\\GeoRequestModel\\Models\\GeoRequestModel does not exist",
"exception": "ReflectionException",
php artisan apiato:model → create a new model with a repository with a name unrelated to the container.Hint: I am new to apiato, Laravel and php, so maybe this is common sense in this domain but it was quite new for me, I'd appreciate it if you could add a paragraph naming conventions for such things.
From the documentation http://apiato.io/components/repositories/
Note: If the Repository belongs to Model with a name different than its Container name, the Repository class of that Model must set the property $container and define the Container name.
Example:
<?php
namespace App\Containers\Authorization\Data\Repositories;
use App\Ship\Parents\Repositories\Repository;
class RoleRepository extends Repository
{
protected $container = 'Authorization'; // the container name. Must be set when the model has different name than the container
protected $fieldSearchable = [
];
}
Thanks for the example. I searched for the info in the models section an did not find it. 馃檪
with the latest update for apiato/core (see here) this issue should be resolved..
If you are using the latest version of apiato/apiato just run composer update to generate the $container property for new (!!!!) repositories
Most helpful comment
with the latest update for
apiato/core(see here) this issue should be resolved..If you are using the latest version of
apiato/apiatojust runcomposer updateto generate the$containerproperty for new (!!!!) repositories