Getting data from database to Admin interface

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Amir
Posts: 13
Joined: 15 Feb 2020, 16:30

Getting data from database to Admin interface

Post by Amir » 25 Feb 2020, 02:09

I want to extend the admin interface to add a page that show the users request services ( I have added a controller and a view for users to add services to the table named "suggested_services" and I want Admin to view them ). I copied the Order folders in JqAdm and I tried to modify it to get the data I want with no luck. which files and methods I should be implementing ? thanks in advance Aimeos

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Getting data from database to Admin interface

Post by aimeos » 26 Feb 2020, 08:35

You can use the Log panel as reference because it's the easiest one if you only want to view data. Copy the Factory.php and Standard.php file and replace "Log" and "log" with "Suggest" and "suggest".

Use your Laravel controllers to retrieve the data and add them to the view to render them in the search() method:
https://github.com/aimeos/ai-admin-jqad ... hp#L31-L89

You need to have a template in ./templates/suggest/list-standard.php that renders the output like this:
https://github.com/aimeos/ai-admin-jqad ... plates/log
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Amir
Posts: 13
Joined: 15 Feb 2020, 16:30

Re: Getting data from database to Admin interface

Post by Amir » 26 Feb 2020, 10:42

thanks for your suggestion I am using the log panel source and template now and renamed the files and the occurrence of the variables and namespace and I have added a link to the navbar And It did show an empty log page but there is an error

Code: Select all

Class "\Aimeos\MAdmin\Suggest\Manager\Factory" not available
]
And btw I added the navbar link in the admin.php in the jqadm array but it removes the dashboard link from the admin panel.

Code: Select all

'navbar' => [
    suggest,
],
 
the second part, I did retrieve the data in my controller ( I put the controller in the App/Http/Controllers ) is that the correct path for aimeos and how to connect it to the view in the Jqadm suggest folder. thanks

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Getting data from database to Admin interface

Post by aimeos » 27 Feb 2020, 07:49

You have to replace that part in your new code by your own one:
https://github.com/aimeos/ai-admin-jqad ... hp#L38-L46

Best by using the Laravel DB facade to retrieve the data you need and add it to the view.

To show the new panel in the navbar, you need to add it to the navbar configuration but also assign permissions for your user group (super, admin or editor) like this:
https://github.com/aimeos/ai-admin-jqad ... #L455-L471
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply