jeudi 2 mai 2019

How to fix 'trim() expects parameter 1 to be string, array given' In Router.php line 560:?

After 'php artisan make:controller Admin/DashboardController', I included code below (Controllers/Admin/DashboardController).

DashboardController.php

namespace App\Http\Controllers\Admin;

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

class DashboardController extends Controller
{
    //Dashboard
    public function dashboard(){
        return view('admin.dashboard');
    }
}

In web.php:

Route::get(['prefix'=>'admin', 'namespace'=>'Admin', 'middleware'=> 
['auth']], function(){
Route::get('/', 'DashboardController@dashboard')->name(admin.index);
});

In views/admin/dashboard.blade.php

@extends('layouts.app)

@section('content')
    <h1>Admin test</h1>
@endsection




Aucun commentaire:

Enregistrer un commentaire