Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b02eb1d
wip
pxpm Apr 1, 2025
418cf70
Apply fixes from StyleCI
StyleCIBot Apr 1, 2025
b5b07e8
wip
pxpm Apr 25, 2025
991a0e0
Apply fixes from StyleCI
StyleCIBot Apr 25, 2025
b31eafd
wip
pxpm May 2, 2025
5524612
Apply fixes from StyleCI
StyleCIBot May 2, 2025
e0489aa
wip
pxpm May 12, 2025
f614449
fix demo filter in icons that makes no sense
tabacitu May 20, 2025
89b5957
wip
pxpm May 21, 2025
7d55d65
Apply fixes from StyleCI
StyleCIBot May 21, 2025
08b2a1c
WIP add datatable widget in places where it makes sense
tabacitu May 26, 2025
9e6671d
Apply fixes from StyleCI
StyleCIBot May 26, 2025
4725ef3
wip
pxpm May 27, 2025
bc51492
Apply fixes from StyleCI
StyleCIBot May 27, 2025
7bbd80b
better demo of datatables component
tabacitu May 27, 2025
f9ccb77
filters that make more sense
tabacitu May 27, 2025
e561494
wip
pxpm May 30, 2025
24e288d
Apply fixes from StyleCI
StyleCIBot May 30, 2025
0e50d52
wip
pxpm May 30, 2025
c78d7e9
Apply fixes from StyleCI
StyleCIBot May 30, 2025
de0139c
wip
pxpm Jun 4, 2025
833b807
Apply fixes from StyleCI
StyleCIBot Jun 4, 2025
b008940
wip
pxpm Jun 4, 2025
88052f6
Apply fixes from StyleCI
StyleCIBot Jun 4, 2025
425cd30
prettier DataTable component on dashboard
tabacitu Jun 5, 2025
bad1775
Apply fixes from StyleCI
StyleCIBot Jun 5, 2025
2267923
add datatable widget to other themes as well
tabacitu Jun 5, 2025
dbccf98
Merge branch 'datatables-component-example' of https://github.com/Lar…
tabacitu Jun 5, 2025
9eb9cfe
wip
pxpm Jun 5, 2025
4f0acac
remove datatable title from dashboard, was not needed
tabacitu Jun 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
pxpm committed Jun 4, 2025
commit de0139c2bc2e046d168728127721569b8846e3a0
17 changes: 7 additions & 10 deletions app/Http/Controllers/Admin/PetShop/OwnerCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function setupShowOperation()
// 'subheader' => 'This is a list of all pets owned by this owner.',
],
// MUST-DO: How the fuck do I make this only show related pets?!?!
'configure' => function ($crud, $parent) {
'setup' => function ($crud, $parent) {
// only show the pets of this owner (owner is an n-n relationship)
if ($parent) {
$crud->addClause('whereHas', 'owners', function ($query) use ($parent) {
Expand All @@ -127,9 +127,6 @@ protected function setupShowOperation()
},
// SHOULD-DO: how do I make a new entry automatically related to the owner?
]);

\Log::info($this->crud->settings());

Widget::add([
'type' => 'datatable',
'controller' => 'App\Http\Controllers\Admin\PetShop\InvoiceCrudController',
Expand All @@ -140,12 +137,12 @@ protected function setupShowOperation()
'header' => 'Invoices for this owner',
],
// MUST-DO: How the fuck do I make this only show related pets?!?!
'configure' => function ($crud, $parent) {
// only show the pets of this owner (owner is an n-n relationship)
if ($parent) {
$crud->addClause('where', 'owner_id', $parent->id);
}
},
'setup' => function ($crud, $parent) {
// only show the pets of this owner (owner is an n-n relationship)
if ($parent) {
$crud->addClause('where', 'owner_id', $parent->id);
}
},
]);
}
}
13 changes: 2 additions & 11 deletions resources/views/vendor/backpack/theme-tabler/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,11 @@

]
];

$widgets['after_content'][] = [
'type' => 'datatable',
'controller' => 'App\Http\Controllers\Admin\PetShop\OwnerCrudController',
'name' => 'owners_crud',
'section' => 'after_content',
'wrapper' => ['class' => 'mt-3'],
'content' => [
'header' => 'Pet Owners',
],
];
@endphp

@section('content')
{{-- In case widgets have been added to a 'content' group, show those widgets. --}}
<x-datatable controller="\App\Http\Controllers\Admin\PetShop\InvoiceCrudController" :setup="function($crud, $parent) { $crud->removeAllColumns(); }" :modifiesUrl="false" name="invoices_table" />

@include(backpack_view('inc.widgets'), [ 'widgets' => app('widgets')->where('group', 'content')->toArray() ])
@endsection