Code Monkey home page Code Monkey logo

Comments (7)

rappasoft avatar rappasoft commented on June 7, 2024 1

I think this is a good start: e9ae10b

Allows you to write like this:

public function columns() : array
    {
        return [
            Column::make('Name')
                ->searchable()
                ->sortable(),
            Column::make('Permissions', 'permissions_label')
                ->customAttribute()
                ->html()
                ->searchable(function($builder, $term) {
                    return $builder->orWhereHas('permissions', function($query) use($term) {
                       return $query->where('name', 'like', '%'.$term.'%');
                    });
                }),
            Column::make('Number of Users', 'users_count')
                ->sortable(),
            Column::make('Actions')
                ->components([
                    Link::make('Edit')
                        ->icon('fas fa-pencil-alt')
                        ->class('btn btn-primary btn-sm')
                        ->href(function($model) {
                            return route('admin.auth.role.edit', $model->id);
                        })
                        ->hideIf(auth()->user()->cannot('access.roles.edit')),
                    Link::make('Delete')
                        ->icon('fas fa-trash')
                        ->class('btn btn-danger btn-sm')
                        ->setAttribute('data-method', 'delete')
                        ->href(function($model) {
                            return route('admin.auth.role.destroy', $model->id);
                        })
                        ->hideIf(auth()->user()->cannot('access.roles.delete')),
                ], function($model) {
                    // Hide components for this row if..
                    return $model->id === config('access.roles.admin');
                }),
        ];
    }

from laravel-livewire-tables.

rappasoft avatar rappasoft commented on June 7, 2024

What would they actually do? Would need to build in the actual functionality to do those things? Or do you just want to generate default buttons and then the actions have to be implemented?

from laravel-livewire-tables.

rabol avatar rabol commented on June 7, 2024

yes, create the default buttons and the developer have to implement the actions

from laravel-livewire-tables.

rappasoft avatar rappasoft commented on June 7, 2024

Ok might be able to put something into there. Do you think they would just point to routes?

from laravel-livewire-tables.

rabol avatar rabol commented on June 7, 2024

yes an array with the actions and the routes

from laravel-livewire-tables.

backstageel avatar backstageel commented on June 7, 2024

Was this removed from the last version? Can´t find those components on the code

from laravel-livewire-tables.

zachary avatar zachary commented on June 7, 2024

Call to undefined method Rappasoft\LaravelLivewireTables\Views\Column::components() (View: /var/www/resources/views/invoices.blade.php)

looks Column has no components function, could you please help this?
Thanks

from laravel-livewire-tables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.