4

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,
        ],
    ],
Dharman
  • 30,962
  • 25
  • 85
  • 135
Faid
  • 554
  • 1
  • 5
  • 18
  • 2
    Yes, you can. You can use any guard for any route - just make sure you configure your routes accordingly. – ceejayoz Jun 20 '19 at 18:10

1 Answers1

0

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

iabu
  • 1
  • 5