0
votes
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests; 

class PostsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
      @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}

when i run the link it is showing below error :

Class 'App\Http\Controllers\Controller' not found and in PostsController.php line 11

1
Welcome, not too much info. Have you made sure that app/Http/Controllers/Controller.php exists? - brombeer

1 Answers

0
votes

i think your namespace of file is incorrect. run composer dump-autoload. try to check that correct file location and namespace of the your controller.if you create the controller in folder then you have to give the proper path in route file during creating route.