I've just migrated a project that was working great on my localhost to a shared hosting and my components suddently are not getting the methods that i gave them and i'm getting errors in my views like so :
Undefined variable: CatPromo
this is my Component :
<?php
namespace App\View\Components;
use Illuminate\View\Component;
use App\Categories;
class promo extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return view('components.promo');
}
public function CatPromo()
{
$Categories = Categories::all();
return $Categories;
}
}
Update : I removed the App\View\Components\promo.php
to see if it can help me by throwing an error and it seems that he don't even detect the controller.