Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zubairamini's avatar

I Have component of News which contain Balde and Php Class in laravel 11, News shows in Windows environment but not shown in Ubuntu environment

News.balde.php is component of laravel :

and this is News.php : <?php

namespace App\View\Components\widget;

use Closure; use Illuminate\View\Component; use Illuminate\Contracts\View\View; use App\Models\Media\News as NewsModal; use Illuminate\Database\Eloquent\Collection;

class News extends Component { public Collection $news;

public function __construct()
{
    $this->news = NewsModal::with(['tags','news_category'])
        ->latest('publish_date')
        ->take(3)
        ->get();
}

public function render(): View|Closure|string
{
    return view('components.widget.news', [
        'news' => $this->news,
    ]);
}

}

and this is where i use it :

                    <x-widget.news  />

                </div>;  in Windows it Work Fine but in Live Server in Ubuntu it give me error of Undefined $news
0 likes
2 replies
Snapey's avatar

Most likely a letter case difference. Windows does not care about upper and lower case file names and class names, but ubuntu does

1 like
martinbean's avatar

@zubairamini Can you try again at formatting your code, please? It’s difficult to read right now as some is formatted and some isn’t.

Please or to participate in this conversation.