I had a fullpage Livewire component Contract, to create a contract, called directly from the routes in web.php:
Route::get('contract', AppHttpLivewire::class)->name('contract.create');
Now I want to switch to having a Resource Controller instead, so my web.php changes to:
Route::resource('contract', ContractController::class);
How can I load the Livewire component from the create function of the controller?
I tried:
class ContractController extends Controller
{
public function create()
{
return view('livewire.contract');
}
what is loading the view correctly, but it is missing all the data that I load from the mount function. Thus, I assume, it is just displaying the view without loading the Livewire class.