Laravel-Backpack / activity-log

MIT License
23 stars 6 forks source link

[Bug] No more links? Maybe? #28

Open tabacitu opened 1 year ago

tabacitu commented 1 year ago

In my tests, the column links don't work 80% of the times... what do you say we remove them? :eyes:

I mean... the way we generate the links is unreliable... we just get the table name, create a route from it and HOPE that links exists. We will be pointing to entries who don't have CRUDs, I'm sure of it. It just depends on the project if it's 10%, 20% or 80%.

So the question is... is it better to point to broken links... or not point at all? :man_shrugging:

tabacitu commented 1 year ago

Of course... it'd be best if we could generate reliable links 😅

And for that... we could instruct people to add a new method to their ActivityLog trait:

public function getAdminPageUrl() {
    return url(route(Str::of($entry->getTable())->singular().".show", ['id' => $this->getKey()]));
}

Then they can override that method in each model, if needed.


BUUT. It would still be unreliable. Because the correct place to get that information is the CrudController... where the dev has defined things in their setup().


Bleah nevermind 🫠 Problem for future-us.

promatik commented 1 year ago

I agree with allowing users to set a method in the model, but, we keep the default on our side. So it's like an override 🤷‍♂️