-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorException Undefined variable: #40
Comments
public function mount( ? Orders $orders) to public function mount(?Orders $orders)
|
Changed the name of the variable to |
Can you please temporarily remove the form tag and just echo out the $order to make sure it is nothing wrong with your variable. |
It seems to me that the variable is not passed from here
|
If I understand you correctly you still get the error when you remove the form from your view?
Or are you trying to use a route that returns the Livewire full page component directly?
|
i got same problem... i hope you can give us some demo to use the element of this package... |
The problem you are experiencing is not due to this package. It is standard php, that you cannot use an undefined variable. In basic Laravel you create a route, you create a controller where you define a variable and you create a view, where you can echo that variable. You can also create routes with optional model binding. With default Livewire you create components. You can pass variables to those components. But the variable must exist. The value of the variable can be Please read Laravel documentation on how to pass variable to Blade components. This package is just a Trait for a Livewire component. It behaves like a standard Livewire component.
Livewire documentation on how to render You have not told me if you are trying to render a full-page component or if you are applying the component in a view. But I can assure you that the problem you are describing does not exist in this package. |
Closing due to lack of response. |
Hello. I am new to laravel. I want to use your package for my project. But something does not work out, I have already read the entire wiki.
Created a form
php artisan make:tall-form createOrder --model=Orders --path=Forms --action=create
/app/Http/Livewire/Forms/createOrder.php
resources/views/livewire/orders.blade.php
<livewire:forms.create-order :orders="$orders" />
I get an error
Laravel 8
Livewire 2.3.1
The text was updated successfully, but these errors were encountered: