title: How to fix 'trim() expects parameter 1 to be string, array given' In Router.php line 560:?
body: <blockquote>
    <p>After 'php artisan make:controller Admin/DashboardController', I included code below (Controllers/Admin/DashboardController). </p>
    
    <p>DashboardController.php</p>
  </blockquote>
  
  <p>
  
  <pre><code>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');
      }
  }
  </code></pre>
  
  <blockquote>
    <p>In web.php:</p>
  </blockquote>
  
  <pre><code>Route::get(['prefix'=&gt;'admin', 'namespace'=&gt;'Admin', 'middleware'=&gt; ['auth']], function() {
      Route::get('/', 'DashboardController@dashboard')-&gt;name(admin.index);
  });
  </code></pre>
  
  <blockquote>
    <p>In views/admin/dashboard.blade.php</p>
  </blockquote>
  
  <pre><code>@extends('layouts.app)
  
  @section('content')
      &lt;h1&gt;Admin test&lt;/h1&gt;
  @endsection
  </code></pre>