Coder Social home page Coder Social logo

Comments (2)

Juhlinus avatar Juhlinus commented on August 19, 2024

Hello @rutvij2292 !

Could you show us what your layout file looks like?

The @inertia directive itself is not very complicated. It contains an app id so that Vue knows where the root element is, as well as passing the $page variable which is passed everytime you create an Inertia response(using the facade or the helper.

        $page = [
            'component' => $this->component,
            'props' => $props,
            'url' => $request->getRequestUri(),
            'version' => $this->version,
        ];

https://github.com/inertiajs/inertia-laravel/blob/master/src/Response.php#L63-L68

If you would like to use the @inertia directive conditionally then I suggest just putting a blade @if and @else directive to control this, and then just make sure that in your controller that when you want to use Inertia then you use the Inertia facade/helper and when you want to use Blade or something else then you use those directives.

If there's anything that seems complicated or that you would like me to further explain then you can join our Discord and ask in the #help channel. You are of course free to continue the conversation here with me and the others, if you so wish. :)

from inertia-laravel.

rutvij2292 avatar rutvij2292 commented on August 19, 2024

@Juhlinus Thanks for your reply. Yes, I tried but I've to tweak ServiceProvider little bit and it worked.

from inertia-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.