help !
error
Fatal error : Class ‘App\controller\CampController’ not found in C:\xampp\htdocs\campappapi\src\dependencies.php on line 33
routes.php
<?php
use Slim\App;
use Slim\Http\Request;
use Slim\Http\Response;
return function (App $app) {
$container = $app->getContainer();
$settings = $container->get('settings');
$app->get('/[{name}]', function (Request $request, Response $response, array $args) use ($container) {
// Render index view
return $response->write($this->db->table("camp")->get());
});
$app->get('/camp/{city_id}/{cat_id}/{result}',\App\controller\CampController::class.":get" );
};
depencies.php
use Psr\Container\ContainerInterface;
use Slim\App;
use App\controller;
return function (App $app) {
$container = $app->getContainer();
// view renderer
$container['renderer'] = function ($c) {
$settings = $c->get('settings')['renderer'];
return new \Slim\Views\PhpRenderer($settings['template_path']);
};
// monolog
$container['logger'] = function ($c) {
$settings = $c->get('settings')['logger'];
$logger = new \Monolog\Logger($settings['name']);
$logger->pushProcessor(new \Monolog\Processor\UidProcessor());
$logger->pushHandler(new \Monolog\Handler\StreamHandler($settings['path'], $settings['level']));
return $logger;
};
// ORM
$container['db'] = function ($container) {
$capsule = new \Illuminate\Database\Capsule\Manager;
$capsule->addConnection($container['settings']['db']);
$capsule->setAsGlobal();
$capsule->bootEloquent();
return $capsule;
};
$container['CampController']= function ($c) {
return new controller\CampController();
};
};
CampController.php
/**
* Created by PhpStorm.
* User: sami
* Date: 25.10.2019
* Time: 10:56
*/
namespace App\controller;
use Psr\Container\ContainerInterface;
use Slim\Http\Request;
use Slim\Http\Response;
class CampController
{ protected $settings;
protected $contanier;
public function __construct(ContainerInterface $c) {
$this->contanier=$c;
$this->settings=$this->contanier->get('settings');
}
public function get(Request $request, Response $response, $args,$settings ){
// Render index view
$result=$this->db->connection()->select("call get_camp_list(?,?,?);",[$args['city_id'],$args['cat_id'],$args['result']]);
foreach($result as $data){
$data->camp_front_photo=$settings['photo_path']. $data->camp_front_photo;
}
return $response->withStatus(200)->withJson($result);
}
}