jet
154
2
Laravel

Cannot use App\Http\Request as Request because the name is already in use

Posted 6 months ago by jet

how can I do to fix this?

here are my codes

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Request;
use App\Article;
use App\Http\Resource\Article as ArticleResource;

class ArticleController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //Get articles
        $articles = Article::paginate(15);

        //Return collection of articles as a resource
        return ArticleResource::collection($articles);
    }

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

Reply to

Use Markdown with GitHub-flavored code blocks.