Official documentation: https://laravel.com/docs/8.x/blade#components
Questions tagged [laravel-components]
34 questions
0
votes
1 answer
laravel - passing data to class-based component, without @props
I have this component:
class CategorySelect extends Component
{
public $id_name, $selected;
public function __construct($selected=-1, $id_name="default_id")
{
$this->id_name = $id_name;
$this->selected = $selected;
…

yossi
- 3,090
- 7
- 45
- 65
0
votes
0 answers
How submitting this form trigger method of a component?
In laravel 9 I have component which I created with command
php artisan make:component ProductCardReport
In app/View/Components/ProductCardReport.php I get some data with eloquent :

mstdmstd
- 2,195
- 17
- 63
- 140
0
votes
1 answer
Laravel : Conditional block for the @foreach() in blade
@foreach (($loop->index == 3 ? FILTER_OPTION_NEW_EXISTING : ($loop->index == 4 ? $franchiseTypes : $categories)) as ($loop->index == 3 ? $key => $value : $item))
How can I attain this one?
The first part of the @foreach depends on the loop->index…

MDB
- 339
- 4
- 19
0
votes
1 answer
Laravel - One component class for multiple component views
I would like to create one "parent" component class that can render multiple different views based on which "child" view you pass in.
For example, I would like to create a directory resources/views/components/icon where I could put…

RileyS
- 11
- 4
0
votes
2 answers
pushing javascript codes at blade does not work out
I have a file called all.blade.php which goes like this:
@component('admin.layouts.content' , ['title' => 'example file'])
@slot('breadcrumb')
Example File
@endslot
…

japose7523
- 29
- 2
- 15
0
votes
1 answer
Including Javascript codes with @stack not working
I'm working with Laravel 8 and I have a master.blade.php goes like this:
@yield('content')