Coder Social home page Coder Social logo

Comments (8)

amiranagram avatar amiranagram commented on April 28, 2024 8

UPDATE:

Here's a quick fix:

Fortify::loginView(function (Request $request) {
    return inertia('Auth/Login')->toResponse($request);
});

@markbiek

from fortify.

markbiek avatar markbiek commented on April 28, 2024

I came to leave this exact issue. Thanks @classjunky

from fortify.

leo95batista avatar leo95batista commented on April 28, 2024

I have the same problem, any official solution?

from fortify.

amiranagram avatar amiranagram commented on April 28, 2024

@leo95batista The solution I provided above works just fine, you can see that on https://xp.amirrami.com.

Although I wish for a simpler solution, since I, like most Laravel developers like to keep it simple.

from fortify.

driesvints avatar driesvints commented on April 28, 2024

Feel free to pr, thanks.

from fortify.

gianlucasg avatar gianlucasg commented on April 28, 2024

Could you tell me how to exactly config Inertia in FortifyServiceProvider? This is how i have FortifyServiceProvider
img1

from fortify.

P-James avatar P-James commented on April 28, 2024

This solution is causing
ErrorException strpos() expects parameter 1 to be string, object given

from \vendor\laravel\framework\src\Illuminate\View\ViewName.php:17

for me

Edit: Updating composer dependencies AND using double quotes on "Auth/Login" has fixed it

from fortify.

emlazaro avatar emlazaro commented on April 28, 2024

I wonder if this is what you're looking for... maybe this could help you or someone out there :)

Using Inertia alone...

Fortify::loginView(function () {
    return Inertia::render('Auth/Login');
});

OR

Using Ziggy with Inertia...

Fortify::loginView(function () {
    return route('login');
});

Given that route('login') is declared as...

//routes/web.php

Route::get('login', [LoginController::class, 'create'])->name('login');
//Auth/LoginController.php

public function create(Request $request, Router $router)
{
    return Inertia::render('Auth/Login');
}

from fortify.

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.