Witam mam problem z PHP'owym frameworkiem Laravel. Gdy probuje podpiac klase z Controllers do web.php z Route wyskakuje mi blad ze nie znaleziono klasy. Kod
PageController.php (w folderze Controllers)
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PageController extends Controller
{
public function show($slug){
$pages = [
'about' => 'aaa'
];
return $pages[$slug];
}
}
web.php ( w folderze routes)
<?php
use Illuminate\Support\Facades\Route;
Route::get('pages/{slug}', 'PageController@show');
plik Controller.php (nie ruszalem go)
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
I screenshot bledu: https://prnt.sc/1x3jg6u
Jesli to istotne programuje na macu z M1. (Laravel poprawnie sie zainstalowal z pomoca Composera).
Ps. Sprawdzilem na drugim laptopie na windowsie - tez nie dziala :'[