Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    i m create new package but some error come database model related?

    Bug Report
    2
    5
    857
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      zainawan99 last edited by

      83bda713-f927-4851-8da9-07be8de76c63-image.png Class ACME\HelloWorld\Providers\ACME\HelloWorld\Models\OrderStatus must extend or implement ACME\HelloWorld\Providers\ACME\HelloWorld\Contracts\OrderStatus.

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi @zainawan99,

        It looks like you have not registered the model. Can you please share the steps that you are trying to do?

        Z 1 Reply Last reply Reply Quote 0
        • Z
          zainawan99 @devansh-webkul last edited by zainawan99

          @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.

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by

            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.

            Z 1 Reply Last reply Reply Quote 0
            • Z
              zainawan99 @devansh-webkul last edited by

              @devansh-webkul hello,
              Ok thanks, they have run

              1 Reply Last reply Reply Quote 1
              • First post
                Last post