Auth not found issue

Posted 3 weeks ago by hasibweb

I am getting the following error.

Auth not found

Here is my code-

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Exceptions\InputException;

class OrderController extends Controller {

    public function index(Request $request) 
    {
        $user = Auth::user();
        $productId = $request->route('productId');

        $product = Product::where('id', $productId)->first();

        return $product;
    }

What wrong I did?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.