Search code examples
laravelvoyager

How can I create a page in voyager without BREAD?


I need to create a page in the admin menu to generate reports from other data in the database. For example: /admin/reports. I want reports to only have access to administrators.


Solution

  • You should try this

    Add browse_reports permission From sql

    INSERT INTO `permissions` (`key`, `table_name`, `created_at`, `updated_at`, `permission_group_id`) VALUES ('browse_reports', NULL, '2018-04-18 12:00:00', '2018-04-18 12:00:00', NULL);
    

    Give this permission to the admin

    Check this permission access to the method which is called for /admin/reports

    In controller

    Voyager::canOrFail('browse_reports');