Is It Possible To Use Laravel Resource With [Web] Guard?

Viewed 166

I'm Using Ajax request for fetching data, It return a Json Response Data which is the same data that I will return when creating API .

The question is: Can I Create Laravel Resource Class and Return that data using (web), (API) Guards ?

auth.php file

'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
            'hash' => false,
        ],
    ],
1 Answers

Yes you can, but make sure you configure your routes accordingly

Related