5
votes

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
Yes, you can. You can use any guard for any route - just make sure you configure your routes accordingly.ceejayoz
@ceejayoz Thank youAbdurrahman

1 Answers

1
votes

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