lundi 7 septembre 2020

Laravel Controller Showing

Showing This Error Target class [App\Http\Controllers\UsersController] does not exist I amusing this in routes/web.php:

 Route::resource('users', 'UsersController');  

*also i ma using this code in controller/UsersController.php

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Users;
class UserController extends Controller
{
    public function index()
    {
        $users = Users::paginate(5);
        return view('users.index', compact('users'));
    }
}`

use App\Users;
use Illuminate\Database\Eloquent\Model;
class Users extends Model
{
    // return $this->belongsToMany(Role::class, 'role_user', 'user_id', 'role_id');
}`


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire