Skip to content

Example of Form Component #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
3 changes: 3 additions & 0 deletions app/Http/Controllers/Admin/IconCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ protected function setupListOperation()
$this->crud->addClause('where', 'created_at', '<=', $value['to']);
}
});

$this->crud->removeButton('update');
$this->crud->addButton('line', 'inline_edit_icon', 'view', 'crud::buttons.inline_edit_icon', 'beginning');
}

protected function setupCreateOperation()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<a href="#" data-toggle="modal" data-bs-toggle="modal" data-target="#myForm{{$entry->getKey()}}" data-bs-target="#myForm{{$entry->getKey()}}" class="btn btn-sm btn-link">
<i class="la la-edit"></i> <span>{{ trans('backpack::crud.edit') }}</span>
</a>

<x-backpack::form-modal
id="myForm{{$entry->getKey()}}"
controller="App\Http\Controllers\Admin\IconCrudController"
modalTitle="Update Icon"
:action="url($crud->route.'/'.$entry->getKey().'')"
:formRouteOperation="url($crud->route.'/'.$entry->getKey().'/edit')"
method="PUT"
refreshDatatable="true"
operation="update"
/>
51 changes: 51 additions & 0 deletions resources/views/vendor/backpack/theme-tabler/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,57 @@
@endphp

@section('content')
<div class="row">
<div class="col-md-6">
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title">
Quick Add Tag
</h3>
</div>
<div class="card-body bg-light">

<x-backpack::form id="quickAddTag"
controller="\Backpack\NewsCRUD\app\Http\Controllers\Admin\TagCrudController" />

</div>
</div>
</div>

<div class="col-md-6">
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title">
Other Quick Actions
</h3>
</div>

<div class="card-body">
<button type="button" class="btn btn-primary" data-toggle="modal" data-bs-toggle="modal" data-target="#addOwnerForm"
data-bs-target="#addOwnerForm">
Add Owner
</button>
<x-backpack::form-modal id="addOwnerForm" controller="\App\Http\Controllers\Admin\PetShop\OwnerCrudController" modalTitle="Add Owner" />

<button type="button" class="btn btn-primary" data-toggle="modal" data-bs-toggle="modal" data-target="#addPetForm"
data-bs-target="#addPetForm">
Add Pet
</button>
<x-backpack::form-modal id="addPetForm" controller="\App\Http\Controllers\Admin\PetShop\PetCrudController"
modalTitle="Add Pet" />

<button type="button" class="btn btn-primary" data-toggle="modal" data-bs-toggle="modal" data-target="#addProductForm"
data-bs-target="#addProductForm">
Add Product
</button>
<x-backpack::form-modal id="addProductForm" controller="\App\Http\Controllers\Admin\ProductCrudController" modalTitle="Add Product" />
</div>
</div>

@include('backpack.theme-tabler::inc.commercial')
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="card card-stacked mt-3">
Expand Down
Loading