Bagisto Forum

    Bagisto

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

    Override index.blade.php example

    Knowledge Base
    2
    5
    889
    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.
    • N
      nessuno last edited by

      Hi, if I wanted to override:

      /var/www/html/bagisto/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php

      According to various answers in the forum, I'd have to go to
      /var/www/html/bagisto/resources/views
      and recreate the view structure from packages for the desired file.

      However, none of the examples actually show how that path would look like, as I have tried multiple combinations and still cannot override.

      Please, Please could someone share the exact path / steps on overriding the above file ? I have created my own package, which works in direct routes, but I wish to override, thanks for your time and help.

      N 1 Reply Last reply Reply Quote 0
      • N
        nessuno @nessuno last edited by nessuno

        @nessuno I've managed, the folder of which overrides worked for me is as:

        /var/www/html/bagisto/resources/views/vendor/admin/layouts/index.blade.php

        Would it be possible to do this but from my own package instead ? my own package is located at bagisto/packages/Ev/Sea .. would it be possible to override from the package instead of doing from the laravel defaults ? thanks,.

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

          Hi @nessuno,

          If you check the Laravel package development guide, you will see that,

          Laravel first try to check the view files in the resources folder,

          for e.g. you have created a view inside a package i.e. admin.layout.index that means laravel will first check the default path i.e. resources/views/admin/layout/index.

          If the view file not found then it will move to your package's view file from there it will load.

          I hope this will solve your problem.

          N 1 Reply Last reply Reply Quote 1
          • N
            nessuno @devansh-webkul last edited by nessuno

            Hi @devansh-webkul

            Thanks for your answer.
            ( I'm old to php but new to laravel ).

            But Laravel will only look in my package for views if I mention so in the custom service provider, correct ?
            ( this->publish or loadFromView ? )

            Please would it be possible to point me to a full example of a custom package that does so ?
            Thanks for your kind help,
            s

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

              Hi @nessuno,

              First one i.e. this->publish. This is will publish your assets.

              Second one i.e. loadFromView. This will load view.

              You can check Bagisto repository there are list of severals packages which will help you in this. Or you can check here i.e. https://devdocs.bagisto.com/1.x/packages/create_package.html.

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