i m create new package but some error come database model related?
-
Class ACME\HelloWorld\Providers\ACME\HelloWorld\Models\OrderStatus must extend or implement ACME\HelloWorld\Providers\ACME\HelloWorld\Contracts\OrderStatus.
-
Hi @zainawan99,
It looks like you have not registered the model. Can you please share the steps that you are trying to do?
-
@devansh-webkul https://devdocs.bagisto.com/1.x/packages/create_package.html#_1-by-using-bagisto-package-generator
I m fellow this link but not run this command(PHP artisan make: model OrderStatus). i m create manually model direct in this package model folder.
-
Hi @zainawan99,
You need two files also,
Now in the same model folder create a class of
OrderStatusProxy
,namespace ACME\HelloWorld\Models; use Konekt\Concord\Proxies\ModelProxy; class OrderStatusProxy extends ModelProxy { }
After that create an interface in contracts folder,
<?php namespace ACME\HelloWorld\Contracts; interface OrderStatus { }
then register your model in the
ModuleServiceProvider
,<?php namespace ACME\HelloWorld\Providers; use Konekt\Concord\BaseModuleServiceProvider; class ModuleServiceProvider extends BaseModuleServiceProvider { protected $models = [ ACME\HelloWorld\Models\OrderStatus::class, ]; }
This is just an explanation, please check namespace accordingly.
-
@devansh-webkul hello,
Ok thanks, they have run