I'm trying to make use of two classes in a controller (FranchiseRepository and OrderRepository), however these classes are not being found in my controller. Here is the class code and stacktrace of the error:
OrderController
namespace App\Controllers;
use \Symfony\Component\HttpFoundation\Request;
use \Symfony\Component\HttpFoundation\Response;
use \App\Services\JsonService as Json;
use \App\Repositories\FranchiseRepository as Franchise;
use \App\Repositories\OrderRepository as Order;
class OrderController
{
protected $franchise;
protected $order;
public function __construct()
{
$this->franchise = new Franchise;
$this->order = new Order;
}
public function sendOrders(Request $req, Response $res)
{
// select all active and enabled to send data to nappsolution franchises
$franchises = $this->franchise->getNappFranchises();
var_dump($franchises);
}
}
FranchiseRepository
namespace App\Repositories;
use App\Models\Franchise;
class FranchiseRepository
{
protected $franchise;
public function __construct()
{
$this->franchise = new Franchise;
}
public function getNappFranchises()
{
return $this->franchise->select('napp_network_id', 'napp_user', 'napp_pass', 'napp_id')
->where([
['active', '=', true],
['napp', '=', true]
])
->get();
}
}
OrderRepository
namespace \App\Repositories;
use App\Models\Order;
class OrderRepository
{
protected $order;
public function __construct()
{
$this->order = new Order;
}
}