mercredi 3 avril 2019

Class App\Http\Controllers\CompaniesController does not exist in Laravel 5.5 error

I'm working on laravel 5.5 and I created a controller called CompaniesController using the command php artisan make controller:CompaniesController --resource. The controller got created along with the resource methods inside App\Http\Controllers.

I tried to assign routes by Route::resource('/createcompany','CompaniesController' ); and it's giving me this error.

Found similar questions(this and this) but they were not helpful.

This is my controller

<?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;

use DB;

class ComapniesController extends Controller
{
/**
 * Display a listing of the resource.
 *
 * @return \Illuminate\Http\Response
 */
public function index()
{
    return view('pages.admin.createcompany');
}

/**
 * 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)
{
    //
}
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Ua0dpc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire