Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.04k stars 885 forks source link

Reorder top buttons not working #5446

Closed alien-rat closed 6 months ago

alien-rat commented 6 months ago

Reorder top buttons not working, cannot get create button to be first.

CRUD::orderButtons('top', ['create','email']);

slika

welcome[bot] commented 6 months ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

karandatwani92 commented 6 months ago

Hey @alien-rat I just tested it and found it working:

CRUD::button('email')->stack('top')->view('crud::buttons.quick');
CRUD::allowAccess('email');
CRUD::orderButtons('top', ['create','email','reorder',]);

Screenshot 2024-02-15 at 2 01 02 PM

I'm on backpack/crud: 6.6.0. Try composer update this may help.

alien-rat commented 6 months ago

`CRUD::addButtonFromView('top', 'create', 'create', 'beginning');

    CRUD::button('email')->stack('top')->view('crud::buttons.quick');
    CRUD::allowAccess('email');
    CRUD::orderButtons('top', `['create','email',]);`

slika

not working..

PHP VERSION:

PHP 8.1.17 (cli) (built: Mar 14 2023 23:07:43) (ZTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.1.17, Copyright (c) Zend Technologies

LARAVEL VERSION:

10.44.0.0

BACKPACK PACKAGE VERSIONS:

backpack/activity-log: 1.0.0 backpack/backupmanager: v5.0.0 backpack/basset: 1.2.2 backpack/crud: 6.6.3 backpack/filemanager: 3.0.7 backpack/generators: v4.0.3 backpack/langfilemanager: 5.0.1 backpack/permissionmanager: 7.1.1 backpack/pro: 2.0.11 backpack/settings: 3.1.0 backpack/theme-coreuiv2: 1.2.3

pxpm commented 6 months ago

Hey @alien-rat thanks for the report. Unfortunately neither me or my colleague @karandatwani92 were able to reproduce the issue, so we will need a little bit more details here.

Where are you writing that code ? Can you provide a stripped down controller with the reproducible error ?

<?php

namespace App\Http\Controllers\Admin;

use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;

class MonsterCrudController extends CrudController
{
    use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;

    public function setup()
    {
        $this->crud->setModel(\App\Models\Monster::class);
        $this->crud->setRoute(config('backpack.base.route_prefix').'/monster');
        $this->crud->setEntityNameStrings('monster', 'monsters');
    }

    public function setupListOperation()
    {
        CRUD::button('email')->stack('top')->view('crud::buttons.quick');
        CRUD::allowAccess('email');
        CRUD::orderButtons('top', ['create','email']);
    }

image

Or if I change to CRUD::orderButtons('top', ['email','create']);

image

Let me know more details .

Thanks.

alien-rat commented 6 months ago

ok, my bad. i was adding lines in setup, not in list. closing