• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

Override index.blade.php example

Knowledge Base
2
5
1.5k
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 15 Nov 2020, 17:08

    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 15 Nov 2020, 17:19 Reply Quote 0
    • N
      nessuno @nessuno last edited by nessuno 15 Nov 2020, 17:19 15 Nov 2020, 17:19

      @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 17 Nov 2020, 05:53

        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 17 Nov 2020, 12:52 Reply Quote 1
        • N
          nessuno @devansh-webkul last edited by nessuno 17 Nov 2020, 14:53 17 Nov 2020, 12:52

          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 18 Nov 2020, 11:07

            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
            3 out of 5
            • First post
              3/5
              Last post