Laravel-Backpack / activity-log

MIT License
23 stars 6 forks source link

[Feature Request] Routes publishing #31

Closed misiekch closed 11 months ago

misiekch commented 11 months ago

Can you make routes be published (as config, views, assets and lang files are) so they can be modified?

promatik commented 11 months ago

Hi @misiekch!

Technically we could make the routes publishable, but I don't see the point 😶

The only public route this package setup is /activity-log, for the list view for the logs of the activities. Is this one that you'd like to change?

pxpm commented 11 months ago

Either publishable, or just se a config value: route_name => 'activity-log would work ?

misiekch commented 11 months ago

Hi @promatik

I wanted to make changes in activity-log controller and replaced it with my own in activity-log routes. However, on second thought, i can also do this by overriding /activity-log route in my custom backpack routes.

promatik commented 11 months ago

Oh! Probably what you want is to Bind the ActivityLogCrudController.

You don't need to create your own routes, just tell Laravel to use your own ActivityLogCrudController instead of the one in the package.


class AppServiceProvider extends ServiceProvider
{
    public $bindings = [
        \Backpack\ActivityLog\Http\Controllers\ActivityLogCrudController::class => \App\Http\Controllers\ActivityLogCrudController::class,
    ];