F
Filamentβ€’7mo ago
Soundmit

Route and livewire pages display error

In my app i have a page with a livewire component
<x-filament-panels::page>
@livewire('list-my-repairs')
</x-filament-panels::page>
<x-filament-panels::page>
@livewire('list-my-repairs')
</x-filament-panels::page>
without a route, i simply call the page /customer/my-repairs but now i need to add the route in my web.php route file
Route::get('/customer/my-repairs', ListMyRepairs::class)->name('customer.repairs');
Route::get('/customer/my-repairs', ListMyRepairs::class)->name('customer.repairs');
ListMyRepairs is the livewire component at the end of the file i call the view
public function render(): view
{
return view('livewire.list-my-repairs');
}
public function render(): view
{
return view('livewire.list-my-repairs');
}
list-my-repairs.blade.php

<div>
{{ $this->table }}
</div>

<div>
{{ $this->table }}
</div>
but i get this error
Livewire page component layout view not found: [components.layouts.app]
Livewire page component layout view not found: [components.layouts.app]
9 Replies
Soundmit
SoundmitOPβ€’7mo ago
and, the page(MyRepairs.php) is located under Filament/customer/Pages (i have a second panel called Customer)
Dennis Koch
Dennis Kochβ€’7mo ago
Why do you register the route manually?
Soundmit
SoundmitOPβ€’7mo ago
because i have in my app a model for managing custom email template fields are: subject, content and LINK link can be internal or external and appear in form of a button in the email i need the route to process the link

@php
use Illuminate\Support\Facades\Route;
@endphp

<x-mail::message>
{!! $emailMessage !!}

@if (isset($links[0]) && array_key_exists('internal', $links[0]))
@if ($links[0]['internal'] == true)
<x-mail::button :url="route($links[0]['url'])">
{!! $links[0]['text'] !!}
</x-mail::button>
@else
<x-mail::button :url="$links[0]['url']">
{!! $links[0]['text'] !!}
</x-mail::button>
@endif
@endif

@if (isset($signature))
{{ $signature }}
@endif
</x-mail::message>

@php
use Illuminate\Support\Facades\Route;
@endphp

<x-mail::message>
{!! $emailMessage !!}

@if (isset($links[0]) && array_key_exists('internal', $links[0]))
@if ($links[0]['internal'] == true)
<x-mail::button :url="route($links[0]['url'])">
{!! $links[0]['text'] !!}
</x-mail::button>
@else
<x-mail::button :url="$links[0]['url']">
{!! $links[0]['text'] !!}
</x-mail::button>
@endif
@endif

@if (isset($signature))
{{ $signature }}
@endif
</x-mail::message>
internal link can be customer.repairs external link https://www.google.com
Dennis Koch
Dennis Kochβ€’7mo ago
link can be internal or external
It doens't make sense to be a Filament page then.
Soundmit
SoundmitOPβ€’7mo ago
? but the page is a filament page in a secondary panel where the user need to login to see his profile there is no solution? i don't want to put a full url in the email template
Dennis Koch
Dennis Kochβ€’7mo ago
I thought it's external? Why do you register it via routes then, when it's already registered in a secondary panel? I am not sure I get your issue. Too late today πŸ™ˆ
Soundmit
SoundmitOPβ€’7mo ago
no no, i try to explain with a pair of screenshot
Soundmit
SoundmitOPβ€’7mo ago
This is a template for an email message. If a link is set, a button will appear in the email. The link of the button can be internal, for example, "Check your profile" (on the app's website), or external, such as "Leave a review on Google." When the link is internal, I use the route name to generate the link. For example, the route customer.repair generates a button link like www.myrepairwebsite.com/customer/my-repair. However, when I added the new route to web.php: Route::get('/customer/my-repairs', ListMyRepairs::class)->name('customer.repairs'); the link in the email is correct, but instead of displaying the customer's repairs page, I get the error: "Livewire page component layout view not found: [components.layouts.app]."
No description
Soundmit
SoundmitOPβ€’7mo ago
i've found an acceptable workaround by using url($links[0]['url']) and save the internal url as /customer/my-repairs
Want results from more Discord servers?
Add your server