jet

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

Posted 4 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.