Need to get single data from relationship in table with where clause
return $table
->columns([
TextColumn::make('name')->sortable(),
TextColumn::make('addresses.title')->label('Address')->sortable(),
]);
I want to pull out one address where order is 1 in address table. Please let me know, How can I pass in above structure?
1 Reply
Maybe this can help : https://laravel.com/docs/10.x/eloquent-relationships#advanced-has-one-of-many-relationships
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.