pingpong-labs / admin

Laravel 5 Admin
https://packagist.org/packages/pingpong/admin
BSD 3-Clause "New" or "Revised" License
432 stars 114 forks source link

Getting 404 not to working view upon installing pingpong-labs admin #17

Closed techxaidz closed 9 years ago

techxaidz commented 9 years ago

Hi there, thankyou for your nice package. I'm new to laravel and i'm currently experiencing difficulty in debugging this problem. I have some Views already functioning and have routes properly configured but when i install your package, something wrong is happening and it throws NotFoundHttpException. As I've reviewed the error log, it shows that it is thrown by your showArticle() method at SiteController but i cannot see a trace or where it was been called in the code or in my routes neither. i guess my routes had been overwritten by your package.

Here's the error log: error laravel

I hope you can point to me where do this error comes from.

techxaidz commented 9 years ago

i've already traced who calls the function showArticle( ) at SiteController. it is the RoutesObserver class,

error laravel Can someone explain to me what RoutesObserver class' do? And why it is called instead of my own route?

arsfeld commented 9 years ago

According to the documentation, you need to call Event::fire('admin::routes'); to add the PingPong Admin's routes to your application.

But that's not what really happens, because in the code it's actually calling that anyway when the extension is registered. And PingPong Admins's routes catch all root url's because of the RoutesObserver you pointed out.

So, this is a pretty nasty bug in this package and the way I solved it was making a private fork of this and removing the line in AdminServideProvider.php@95. Hope it helps!

gravitano commented 9 years ago

@techxaidz : You have to update the post.permalink option in admin interface, for example : post/{slug}.

techxaidz commented 9 years ago

thanks for the fast responses there. i guess i need to make a private fork also,

@gravitano : what does the post.permalink actually do? what do i replace to that code? can you give a little more spoonfeed-like example?

sorry for i am a newbie

arsfeld commented 9 years ago

@gravitano I suggest you put that in the documentation (and remove the part of the events in the routes file), it would have saved a lot of time for me

techxaidz commented 9 years ago

@arsfeld : i tried what you suggested and it worked! looking forward for a proper solution / documentation regarding this problem.

thankyou