• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Issue with Laravel Component Variable

eliamarsura

Basic Pleskian
Server operating system version
Debian 11.9
Plesk version and microupdate number
18.0.59.2
Hello :)

I'm using Plesk, and I've deployed a new Laravel application.

From the Laravel toolkit, I run the command
Code:
php artisan make:component sidebarnominativi
.

So far, so good. It creates the controller in
Code:
app/View/Components/sidebarnominativi.php
and the blade file in
Code:
resources/views/components/sidebarnominativi.blade.php
.

I open the controller and create a simple function that passes the variable `$nominativi`:

PHP:
public function render(): View|Closure|string

{

    $nominativi = "prova";

    return view('components.sidebarnominativi', compact('nominativi'));

}

I call it in the blade:

HTML:
<div>
    {{ $nominativi }}
</div>

I insert my component in `resources/views/welcome.blade.php` like this:

HTML:
<x-sidebarnominativi />

The result is that when I visit the project's homepage, I receive the error:

Code:
Undefined variable $nominativi (View: serverpath/resources/views/components/sidebarnominativi.blade.php)

Below are all the environment details:
- PHP Version: 8.3.4
- Laravel Version: 10.48.4
- Laravel Config Cached: false
- App Debug: true
- App Env: local

I've already tried the following commands:
- `php artisan view:cache`
- `php artisan view:clear`
- `composer update`
- `composer install`
- `composer dump`

None of these commands generate any errors, and they are not resolving the issue.

I've also tried changing the framework version to `v10.39.0`.

Has anyone ever encountered this issue before?
 
Back
Top