Skip to content

[WIP] Next Demo version #669

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 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
81cff00
require next version of CRUD, PRO and medialibrary-uploaders
tabacitu Nov 7, 2024
4ab9a1a
add ckeditor and tinymce addons
tabacitu Nov 7, 2024
6bafb4a
require next version of CRUD, PRO and medialibrary-uploaders
tabacitu Nov 7, 2024
d805397
add ckeditor and tinymce addons
tabacitu Nov 7, 2024
3fb9232
add basset folder to gitignore
pxpm Nov 19, 2024
bc7cdcc
use next branch for file manager
pxpm Nov 19, 2024
ffc6a66
ran composer update
pxpm Nov 19, 2024
0d95d10
fix uploaders in monster demo
pxpm Dec 3, 2024
53bc007
Apply fixes from StyleCI
StyleCIBot Dec 3, 2024
14ec11d
remove wysiwyg
pxpm Dec 5, 2024
59232ab
ran composer update
pxpm Dec 5, 2024
ceb52d9
Apply fixes from StyleCI
StyleCIBot Dec 5, 2024
0449a67
run composer update
pxpm Jan 2, 2025
ff90202
ran composer update
pxpm Jan 22, 2025
897be66
remove published files
pxpm Jan 23, 2025
2664ddf
change from null to empty string
pxpm Jan 23, 2025
630efaa
v7 - run composer update
tabacitu Jan 27, 2025
4b52ebe
Merge branch 'next' of github.com:Laravel-Backpack/demo into next
pxpm Jan 28, 2025
ab44208
wip
pxpm Jan 28, 2025
0672688
wip
pxpm Feb 7, 2025
7ee3e6d
ran composer update
pxpm Feb 18, 2025
609053a
wip
pxpm Mar 12, 2025
ccf4695
wip
pxpm Mar 12, 2025
fb07225
add datatable component examples (#697)
tabacitu Jun 9, 2025
5917666
ran composer update
tabacitu Jun 10, 2025
310ef63
add datagrid to Demo (#699)
tabacitu Jun 19, 2025
95689be
only text-white on horizontal-overlap layout
tabacitu Jun 20, 2025
14de541
ran composer update
tabacitu Jun 20, 2025
e6f1c0a
Dataform component examples (#700)
pxpm Jun 24, 2025
de2d05e
use the class names
pxpm Jun 24, 2025
714583f
add chips examples (#701)
tabacitu Jun 25, 2025
02ab816
Theme switch modal only on tabler (#703)
tabacitu Jun 27, 2025
bffe506
add ability to enable/disable CSS skins in tabler theme switcher modal
tabacitu Jun 27, 2025
0e82cc5
ran composer update
tabacitu Jun 27, 2025
f35f0de
run composer update
pxpm Jun 27, 2025
805e7e4
Merge pull request #704 from Laravel-Backpack/ran-composer-update
pxpm Jun 27, 2025
175c453
ran composer update to get CRUD v7-beta1 and Basset v2-beta1
tabacitu Jun 28, 2025
c5310b8
update httaccess file to match laravel
pxpm Jul 1, 2025
f301217
ran composer update
pxpm Jul 1, 2025
d3ce3f6
updated crud
pxpm Jul 1, 2025
8549e7d
Merge pull request #705 from Laravel-Backpack/update-httaccess-file
pxpm Jul 1, 2025
0c4a586
ran composer update
pxpm Jul 1, 2025
0d18c01
Merge pull request #706 from Laravel-Backpack/ran-composer-update-beta4
pxpm Jul 1, 2025
89b5cbd
ran composer update
pxpm Jul 7, 2025
1a2fdea
Merge pull request #707 from Laravel-Backpack/run-composer-update
pxpm Jul 7, 2025
ced8677
ran composer update
pxpm Jul 8, 2025
990765c
Merge pull request #708 from Laravel-Backpack/filemanager-update
pxpm Jul 8, 2025
e925186
wip
pxpm Jul 14, 2025
413bcec
Apply fixes from StyleCI
StyleCIBot Jul 14, 2025
dc5a853
Merge pull request #710 from Laravel-Backpack/fixes-and-run-composer-…
pxpm Jul 14, 2025
64f3aa6
set maintenaince while refreshing the database
pxpm Jul 14, 2025
c2e8f44
Merge pull request #711 from Laravel-Backpack/set-the-website-in-main…
pxpm Jul 14, 2025
cd50afc
wip
pxpm Jul 14, 2025
5fd4c97
Merge pull request #712 from Laravel-Backpack/run-composer-update
pxpm Jul 14, 2025
a6a3585
ran composer update
pxpm Jul 16, 2025
754f14d
Merge pull request #713 from Laravel-Backpack/run-composer-update-
pxpm Jul 16, 2025
6cfd115
composer update
pxpm Jul 16, 2025
9697f95
Merge pull request #714 from Laravel-Backpack/run-composer-update
pxpm Jul 16, 2025
599941b
composer update
pxpm Jul 17, 2025
86c5b07
Merge pull request #715 from Laravel-Backpack/run-composer-updat
pxpm Jul 17, 2025
31bba1c
use sqlite as default db engine in demo to remove friction
pxpm Jul 22, 2025
225f27d
Apply fixes from StyleCI
StyleCIBot Jul 22, 2025
cea01fa
Merge pull request #716 from Laravel-Backpack/make-sqlite-the-default
pxpm Jul 22, 2025
9a1b1ce
wip
pxpm Jul 22, 2025
71e9ee8
Merge pull request #717 from Laravel-Backpack/composer-update
pxpm Jul 22, 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
18 changes: 9 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ APP_URL=http://localhost
BACKPACK_THEME=backpack.theme-tabler

# MySQL Database Connection
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
#DB_CONNECTION=mysql
#DB_HOST=127.0.0.1
#DB_PORT=3306
#DB_DATABASE=homestead
#DB_USERNAME=homestead
#DB_PASSWORD=secret

# PostgreSQL Database Connection
#DB_CONNECTION=pgsql
Expand All @@ -22,9 +22,9 @@ DB_PASSWORD=secret
#DB_PASSWORD=

# SQLite Database Connection
# You might also need to run 'touch storage/app/database.sqlite` to create the db
#DB_CONNECTION=sqlite
#DB_DATABASE=../storage/app/database.sqlite
# You might also need to run 'touch storage/app/database.sqlite` to create the db if the file does not exist.
DB_CONNECTION=sqlite
DB_DATABASE=./storage/app/database.sqlite

CACHE_DRIVER=file
SESSION_DRIVER=file
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Homestead.json
/.vscode
/packages
/_volumes
/public/basset
2 changes: 2 additions & 0 deletions app/Console/Commands/RefreshDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ public function __construct()
*/
public function handle()
{
Artisan::call('down');
Log::warning('Cleanup time. Refreshing the database.');
Artisan::call('db:wipe --force');
Artisan::call('migrate --force');
Artisan::call('db:seed --force');
Artisan::call('backup:clean');
Artisan::call('up');
}
}
19 changes: 19 additions & 0 deletions app/Http/Controllers/Admin/AdminPageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Http\Controllers\Admin;

class AdminPageController
{
/**
* Show the new in v7 page.
*
* @return \Illuminate\View\View
*/
public function newInV7()
{
return view('admin.new-in-v7', [
'title' => 'New in v7',
'description' => 'Discover the new features and improvements in Backpack v7.',
]);
}
}
12 changes: 12 additions & 0 deletions app/Http/Controllers/Admin/CaveCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CaveCrudController extends CrudController
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
use \Backpack\Pro\Http\Controllers\Operations\AjaxUploadOperation { ajaxUpload as traitAjaxUpload; }

/**
* Configure the CrudPanel object. Apply settings to all operations.
Expand Down Expand Up @@ -147,4 +148,15 @@ public static function getMonsterSubfields()

return $subfields;
}

public function ajaxUpload()
{
if (app('env') === 'production') {
return response()->json(['errors' => [
'message' => 'Uploads are disabled in production.',
]], 500);
}

return $this->traitAjaxUpload();
}
}
12 changes: 12 additions & 0 deletions app/Http/Controllers/Admin/DummyCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DummyCrudController extends CrudController
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;
use \Backpack\Pro\Http\Controllers\Operations\AjaxUploadOperation { ajaxUpload as traitAjaxUpload; }

public function setup()
{
Expand Down Expand Up @@ -186,4 +187,15 @@ protected function groups()

return $groups;
}

public function ajaxUpload()
{
if (app('env') === 'production') {
return response()->json(['errors' => [
'message' => 'Uploads are disabled in production.',
]], 500);
}

return $this->traitAjaxUpload();
}
}
6 changes: 0 additions & 6 deletions app/Http/Controllers/Admin/FluentMonsterCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,6 @@ protected function setupCreateOperation()
->type('summernote')
->label('Summernote editor')
->tab('Big texts');

CRUD::field('wysiwyg')
->type('ckeditor')
->label('CKEditor - also called the WYSIWYG field')
->tab('Big texts');

CRUD::field('tinymce')
->type('tinymce')
->label('TinyMCE')
Expand Down
14 changes: 14 additions & 0 deletions app/Http/Controllers/Admin/IconCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ public function setup()
protected function setupListOperation()
{
$this->crud->addColumns(['name', 'icon']);

$this->crud->addFilter([
'type' => 'date_range',
'name' => 'created_at',
'label' => 'Created At',
], null, function ($value) {
$value = json_decode($value, true);

// if the filter is active
if ($value) {
$this->crud->addClause('where', 'created_at', '>=', $value['from']);
$this->crud->addClause('where', 'created_at', '<=', $value['to']);
}
});
}

protected function setupCreateOperation()
Expand Down
84 changes: 61 additions & 23 deletions app/Http/Controllers/Admin/MonsterCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Http\Requests\MonsterRequest as StoreRequest;
// VALIDATION: change the requests to match your own file names if you need form validation
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Library\Widget;
use Illuminate\Support\Collection;

class MonsterCrudController extends CrudController
Expand All @@ -15,8 +16,8 @@ class MonsterCrudController extends CrudController
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;
use \Backpack\Pro\Http\Controllers\Operations\DropzoneOperation { dropzoneUpload as traitDropzone; }
use \App\Http\Controllers\Admin\Operations\SMSOperation; //Custom Form Operation Example
use \Backpack\Pro\Http\Controllers\Operations\AjaxUploadOperation { ajaxUpload as traitAjaxUpload; }
use Operations\SMSOperation; //Custom Form Operation Example
use \Backpack\ActivityLog\Http\Controllers\Operations\ModelActivityOperation;
use \Backpack\ActivityLog\Http\Controllers\Operations\EntryActivityOperation;

Expand Down Expand Up @@ -64,7 +65,7 @@ public function fetchPaginatedTypes()
['id' => 'review', 'title' => 'Review', 'location' => 'Hybrid'],
];

Collection::macro('paginate', function (int $perPage = 15, int $page = null, array $options = []) {
Collection::macro('paginate', function (int $perPage = 15, ?int $page = null, array $options = []) {
$page ??= \Illuminate\Pagination\Paginator::resolveCurrentPage() ?? 1;

return new \Illuminate\Pagination\LengthAwarePaginator($this->forPage($page, $perPage)->toArray(), $this->count(), $perPage, $page, $options);
Expand Down Expand Up @@ -279,6 +280,53 @@ public function setupListOperation()

public function setupShowOperation()
{
// add a widget
Widget::add([
'type' => 'datatable',
'controller' => 'App\Http\Controllers\Admin\IconCrudController',
'name' => 'icon_crud',
'section' => 'after_content',
'content' => [
'header' => 'Icons for this monster',
],
'wrapper' => ['class'=> 'mb-3'],
]);

Widget::add([
'type' => 'datatable',
'controller' => 'App\Http\Controllers\Admin\ProductCrudController',
'name' => 'products_datatable',
'section' => 'after_content',
'content' => [
'header' => 'Products for this monster',
],
'wrapper' => ['class'=> 'mb-3'],
'configure' => function ($crud, $entry = null) {
// Customize which columns to show
$crud->removeAllColumns();
$crud->addColumn(['name' => 'name', 'label' => 'Product Name']);
$crud->addColumn(['name' => 'price', 'label' => 'Price']);

// Get the current monster's products
if ($entry) {
$productIds = $entry->products->pluck('id')->toArray();
if (count($productIds) > 0) {
// Configure the controller to only show products related to this monster
$crud->addClause('whereIn', 'id', $productIds);
} else {
// Force an empty result when there are no products
$crud->addClause('where', 'id', 0); // This will match no products
}

// Remove buttons that aren't needed for this embedded view

// Disable features that aren't needed
$crud->denyAccess(['create', 'update', 'delete']);
$crud->disableResponsiveTable();
}
},
]);

$this->crud->setOperationSetting('tabsEnabled', true);
$this->setupListOperation();

Expand Down Expand Up @@ -320,13 +368,6 @@ public function setupShowOperation()
'tab' => 'WYSIWYG Editors',
]);

$this->crud->addColumn([
'name' => 'wysiwyg',
'type' => 'wysiwyg',
'label' => 'Wysiwyg'.backpack_pro_badge(),
'tab' => 'WYSIWYG Editors',
]);

$this->crud->addColumn([
'name' => 'features',
'label' => 'Features'.backpack_pro_badge(),
Expand Down Expand Up @@ -1703,10 +1744,11 @@ public static function getFieldsArrayForWysiwygEditorsTab()
'tab' => 'WYSIWYG Editors',
],
[ // Summernote
'name' => 'summernote',
'label' => 'Summernote editor'.backpack_free_badge(),
'type' => 'summernote',
'tab' => 'WYSIWYG Editors',
'name' => 'summernote',
'label' => 'Summernote editor'.backpack_free_badge(),
'type' => 'summernote',
'tab' => 'WYSIWYG Editors',
'withFiles' => true,
],
[ // CKEditor
'name' => 'ckeditor',
Expand All @@ -1720,12 +1762,6 @@ public static function getFieldsArrayForWysiwygEditorsTab()
'type' => 'tinymce',
'tab' => 'WYSIWYG Editors',
],
[ // Wysiwyg
'name' => 'wysiwyg',
'label' => 'Wysiwyg'.backpack_pro_badge(),
'type' => 'wysiwyg',
'tab' => 'WYSIWYG Editors',
],
];
}

Expand Down Expand Up @@ -1837,15 +1873,17 @@ public static function getFieldsArrayForMiscellaneousTab()
];
}

public function dropzoneUpload()
public function ajaxUpload()
{
if (app('env') === 'production') {
return response()->json(['errors' => [
'dropzone' => ['Uploads are disabled in production'],
'dropzone' => ['Uploads are disabled in production'],
'easymde' => ['Uploads are disabled in production'],
'summernote' => ['Uploads are disabled in production'],
],
], 500);
}

return $this->traitDropzone();
return $this->traitAjaxUpload();
}
}
41 changes: 33 additions & 8 deletions app/Http/Controllers/Admin/PetShop/InvoiceCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Http\Requests\InvoiceRequest;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
use Backpack\CRUD\app\Library\Widget;

/**
* Class InvoiceCrudController.
Expand Down Expand Up @@ -53,19 +54,32 @@ public function setupLast5YearsView()
protected function setupListOperation()
{
CRUD::addColumn([
'name' => 'owner',
'label' => 'Owner',
'linkTo' => [
'route' => 'owner.show',
'target' => '_blank',
],
'name' => 'info',
'type' => 'view',
'view' => 'crud::chips.invoice',
]);
CRUD::column('series');
CRUD::column('number');
CRUD::column('issuance_date');
CRUD::column('due_date');
CRUD::column('total');

CRUD::filter('series')
->type('dropdown')
->values(\App\Models\PetShop\Invoice::select('series')->distinct()->pluck('series', 'series')->toArray())
->label('Series')
->placeholder('Search by series')
->whenActive(function ($value) {
CRUD::addClause('where', 'series', '=', $value);
});

CRUD::filter('issuance_date')
->type('date_range')
->label('Issuance Date')
->placeholder('Search by issuance date')
->whenActive(function ($value) {
$dates = json_decode($value);
CRUD::addClause('whereBetween', 'issuance_date', [$dates->from, $dates->to]);
});

$this->runCustomViews();
}

Expand Down Expand Up @@ -130,6 +144,17 @@ protected function setupShowOperation()
$this->autoSetupShowOperation();

CRUD::column('total');

// get the owner with important relationships
$owner = CRUD::getCurrentEntry()->owner()->with('avatar', 'invoices')->first();

// add a chip widget for the owner
Widget::add()
->to('after_content')
->type('chip')
->view('crud::chips.owner')
->title('Owner')
->entry($owner);
}

public function fetchOwner()
Expand Down
Loading