Closed prescriptionlifeline closed 3 weeks ago
In my database table I have, among other columns, note and uniformAgreement, in that order. I want to make it so that in the CRUD HTML notes appears after uniformAgreement even tho, in the DB, it appears before.
note
uniformAgreement
notes
To that end I tried this:
CRUD::field(['name' => 'notes'])->afterField('uniformAgreement');
I expected the Notes field to appear after the uniform agreement.
The Notes field is appearing before the uniform agreement field:
I tried afterField. Not sure what else I can try.
afterField
Yes
After I run composer update backpack/crud the bug... is it still there?
composer update backpack/crud
Yes.
When I run php artisan backpack:version the output is:
php artisan backpack:version
### PHP VERSION: 8.1.2-1ubuntu2.17 ### PHP EXTENSIONS: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache ### LARAVEL VERSION: 10.43.0.0 ### BACKPACK PACKAGE VERSIONS: backpack/basset: 1.2.4 backpack/crud: 6.7.15 backpack/filemanager: 3.0.7 backpack/generators: v4.0.3 backpack/pro: 2.1.8 backpack/theme-tabler: 1.2.5
Hello @prescriptionlifeline
Can you try this:
CRUD::field(['name' => 'notes'])->after('uniformAgreement');
Let me know if thats work for you.
Cheers.
That worked - thanks!
Bug report
What I did
In my database table I have, among other columns,
note
anduniformAgreement
, in that order. I want to make it so that in the CRUD HTMLnotes
appears afteruniformAgreement
even tho, in the DB, it appears before.To that end I tried this:
What I expected to happen
I expected the Notes field to appear after the uniform agreement.
What happened
The Notes field is appearing before the uniform agreement field:
What I've already tried to fix it
I tried
afterField
. Not sure what else I can try.Is it a bug in the latest version of Backpack?
Yes
Yes.
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is: