├── .DS_Store ├── .editorconfig ├── .github ├── config.yml ├── dependabot.yml ├── issue_template.md ├── pull_request_template.md ├── release-drafter.yml ├── stale.yml ├── support.yml └── workflows │ └── add-to-project.yml ├── .gitignore ├── .scrutinizer.yml ├── .styleci.yml ├── .travis.yml ├── CHANGELOG.md ├── CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json └── src ├── MenuCRUDServiceProvider.php ├── app ├── Http │ └── Controllers │ │ └── Admin │ │ └── MenuItemCrudController.php └── Models │ └── MenuItem.php ├── database └── migrations │ └── 2016_05_05_115641_create_menu_items_table.php ├── resources └── views │ └── fields │ └── page_or_link.blade.php └── routes └── backpack └── menucrud.php /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laravel-Backpack/MenuCRUD/fa591e946c3bcacb507d95f22e958a17e2ab44ec/.DS_Store -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This file is for unifying the coding style for different editors and IDEs. 2 | ; More information at http://editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | indent_size = 4 9 | indent_style = space 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.github/config.yml: -------------------------------------------------------------------------------- 1 | # Configuration for welcome - https://github.com/behaviorbot/welcome 2 | 3 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome 4 | 5 | # Comment to be posted to on first time issues 6 | newIssueWelcomeComment: > 7 | Hello there! Thanks for opening your first issue on this repo! 8 | 9 | 10 | Just a heads-up: **Here at Backpack we use Github Issues only for tracking bugs**. Talk about new features is also acceptable. This helps _a lot_ in keeping our focus on improving Backpack. **If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below)**. If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. 11 | 12 | 13 | Backpack communication mediums: 14 | - Bug Reports, Feature Requests - Github Issues (here); 15 | - Quick help (_How do I do X_) - [Gitter Chatroom](gitter.im/BackpackForLaravel/Lobby); 16 | - Long questions (_I have done X and Y and it won't do Z wtf_) - [Stackoverflow](https://stackoverflow.com/questions/tagged/backpack-for-laravel), using the ```backpack-for-laravel``` tag; 17 | 18 | 19 | Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome _awesome_ community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. 20 | 21 | 22 | Thank you! 23 | 24 | 25 | -- 26 | 27 | Justin Case 28 | 29 | The Backpack Robot 30 | 31 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome 32 | 33 | # Comment to be posted to on PRs from first time contributors in your repository 34 | newPRWelcomeComment: > 35 | BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly. 36 | 37 | 38 | Please keep in mind that: 39 | - **if this constitutes a breaking change, it might take quite a while for this to get merged**; we try to emulate the Laravel release cycle as much as possible, so developers can upgrade both software once; this means a new big release every ~6 months; 40 | - **even if it's a non-breaking change, it might take a few days/weeks for the PR to get merged**; unless it's a no-brainer, **we like to have some community feedback on new features, before we merge them**; this leads to higher-quality code, in the end; we learnt this the hard way :-) 41 | - **not all PRs get merged**; sometimes we just have to hold out new features, to keep the packages lean; sometimes we don't include features that only apply to niche use cases; 42 | - **we're not perfect**; if you think we're wrong, call us out on it; but in a kind way :-) we all make mistakes, best we learn from them and build better software together; 43 | 44 | 45 | Thank you! 46 | 47 | 48 | -- 49 | 50 | Justin Case 51 | 52 | The Backpack Robot 53 | 54 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge 55 | 56 | # Comment to be posted to on pull requests merged by a first time user 57 | firstPRMergeComment: > 58 | WHOOP-WHOOP! Congrats, your first PR on this repo has officialy been merged. 59 | 60 | 61 | ![party](https://media1.giphy.com/media/3KC2jD2QcBOSc/giphy.gif "Party!!!") 62 | 63 | 64 | If you want to help out the community in other ways, you can: 65 | - **give your opinion on other Github Issues & PRs**; 66 | - **chat with others** in the [Gitter Chatroom](gitter.im/BackpackForLaravel/Lobby) (usually for quick help: _How do I do X_); 67 | - **answer Backpack questions on [Stackoverflow](https://stackoverflow.com/questions/tagged/backpack-for-laravel)**; you get points, people get help; you can subscribe to the ```backpack-for-laravel``` tag by [adding a new filter](https://stackexchange.com/filters/256210/my-filter-3); that will send you emails when new questions come up with our tag; 68 | 69 | 70 | Again. Thank you for the PR. You are a wonderful person. Keep 'em coming :-) 71 | 72 | Cheers! 73 | 74 | 75 | -- 76 | 77 | Justin Case 78 | 79 | The Backpack Robot 80 | 81 | 82 | P.S. **Help in the Backpack community is rewarded with free Backpack commercial licenses**. It's the least we can do. If you feel you've helped the community with PRs, help & other stuff, please [shoot Tabacitu an email](mailto:hello@tabacitu.ro) and ask him if you qualify for free licenses. You scratch my back, I scratch your back. Thank you! 83 | 84 | # It is recommend to include as many gifs and emojis as possible 85 | # 86 | # --------------------------------------------------------------------------------------------- 87 | # 88 | # Configuration for request-info - https://github.com/behaviorbot/request-info 89 | 90 | # *OPTIONAL* Comment to reply with 91 | # Can be either a string : 92 | requestInfoReplyComment: > 93 | Hi there! 94 | 95 | 96 | Could you please provide us with more info about this? Looks like you skipped the title/body. 97 | 98 | 99 | Thank you! 100 | 101 | 102 | -- 103 | 104 | Justin Case 105 | 106 | The Backpack Robot 107 | 108 | # Or an array: 109 | # requestInfoReplyComment: 110 | # - Ah no! young blade! That was a trifle short! 111 | # - Tell me more ! 112 | # - I am sure you can be more effusive 113 | 114 | 115 | # *OPTIONAL* default titles to check against for lack of descriptiveness 116 | # MUST BE ALL LOWERCASE 117 | requestInfoDefaultTitles: 118 | # - update readme.md 119 | - updates 120 | 121 | # *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given 122 | requestInfoLabelToAdd: needs-more-info 123 | 124 | # *OPTIONAL* Only warn about insufficient information on these events type 125 | # Keys must be lowercase. Valid values are 'issue' and 'pullRequest' 126 | requestInfoOn: 127 | pullRequest: true 128 | issue: true 129 | 130 | # *OPTIONAL* Add a list of people whose Issues/PRs will not be commented on 131 | # keys must be GitHub usernames 132 | requestInfoUserstoExclude: 133 | - tabacitu 134 | 135 | # --------------------------------------------------------------------------------------------- 136 | # 137 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: composer 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | open-pull-requests-limit: 10 8 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | # Bug report 2 | 3 | ### What I did: 4 | 5 | ### What I expected to happen: 6 | 7 | ### What happened: 8 | 9 | ### What I've already tried to fix it: 10 | 11 | ### Backpack, Laravel, PHP, DB version: 12 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## WHY 2 | 3 | ### BEFORE - What was wrong? What was happening before this PR? 4 | 5 | ?? 6 | 7 | ### AFTER - What is happening after this PR? 8 | 9 | ?? 10 | 11 | 12 | ## HOW 13 | 14 | ### How did you achieve that, in technical terms? 15 | 16 | ?? 17 | 18 | 19 | 20 | ### Is it a breaking change or non-breaking change? 21 | 22 | ?? 23 | 24 | 25 | ### How can we test the before & after? 26 | 27 | ?? 28 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | # branches to consider in the event; optional, defaults to all 6 | branches: 7 | - master 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into "master" 14 | - uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | 18 | name-template: 'v$NEXT_PATCH_VERSION 🌈' 19 | tag-template: 'v$NEXT_PATCH_VERSION' 20 | categories: 21 | - title: '🚀 Features' 22 | labels: 23 | - 'feature' 24 | - 'enhancement' 25 | - 'added' 26 | - title: '🐛 Bug Fixes' 27 | labels: 28 | - 'fix' 29 | - 'bugfix' 30 | - 'bug' 31 | - 'fixed' 32 | - title: '⚙️ Changes' 33 | labels: 34 | - 'changed' 35 | - 'dependencies' 36 | - title: '🧰 Removed' 37 | label: 'removed' 38 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 39 | template: | 40 | ## Changes 41 | 42 | $CHANGES -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | ##################################### 2 | # Github Stale Probot Configuration # 3 | # ################################### 4 | # https://probot.github.io/apps/stale/ 5 | 6 | # Number of days of inactivity before an issue becomes stale 7 | daysUntilStale: 60 8 | # Number of days of inactivity before a stale issue is closed 9 | daysUntilClose: 14 10 | # Issues with these labels will never be considered stale 11 | exemptLabels: 12 | - pinned 13 | - security 14 | - feature 15 | - urgent 16 | - ready 17 | - working on it 18 | - bug 19 | 20 | # Label to use when marking an issue as stale 21 | staleLabel: stale 22 | # Comment to post when marking an issue as stale. Set to `false` to disable 23 | markComment: > 24 | Hi there! 25 | 26 | 27 | **Is this still an issue?** No activity in 60 days. I'm going to mark it as stale for now, and close it in 14 days if no further activity occurs. I know you guys are all busy, but if this is important to you please reply or something, so I know not to close it. 28 | 29 | 30 | Thank you! 31 | 32 | 33 | -- 34 | 35 | Justin Case 36 | 37 | The Backpack Robot 38 | 39 | # Comment to post when closing a stale issue. Set to `false` to disable 40 | closeComment: true 41 | -------------------------------------------------------------------------------- /.github/support.yml: -------------------------------------------------------------------------------- 1 | # Configuration for support-requests - https://github.com/dessant/support-requests 2 | 3 | # Label used to mark issues as support requests 4 | supportLabel: Ask-It-On-Stack-Overflow 5 | # Comment to post on issues marked as support requests. Add a link 6 | # to a support page, or set to `false` to disable 7 | supportComment: > 8 | Oups! 9 | 10 | 11 | Looks like this is a support request, not a bug/feature. **Could you please [repost on StackOverflow](https://stackoverflow.com/questions/tagged/backpack-for-laravel), using the ```backpack-for-laravel``` tag**? 12 | 13 | 14 | Background: **Here at Backpack we use Github Issues only for tracking bugs and features**, not individual implementation issues. This helps _a lot_ in keeping our focus on improving Backpack. Thanks a lot for understanding! 15 | 16 | 17 | Here are all the Backpack communication mediums: 18 | - Long questions (_I have done X and Y and it won't do Z wtf_) - [Stackoverflow](https://stackoverflow.com/questions/tagged/backpack-for-laravel), using the ```backpack-for-laravel``` tag; this is recommended for most questions, since other developers can then find the answer on a simple Google search; also, people get points for answering - and who doesn't like StackOverflow points?! 19 | - Quick help (_How do I do X_) - [Gitter Chatroom](https://gitter.im/BackpackForLaravel/Lobby); 20 | - Bug Reports, Feature Requests - Github Issues (here); 21 | 22 | Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or StackOverflow is thanks to our awesome _awesome_ community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. 23 | 24 | 25 | Thank you! 26 | 27 | 28 | -- 29 | 30 | Justin Case 31 | 32 | The Backpack Robot 33 | 34 | 35 | PS. In case I mistakenly closed your issue, yell :-) I'm a robot, I make mistakes. 36 | 37 | # Whether to close issues marked as support requests 38 | close: true 39 | # Whether to lock issues marked as support requests 40 | lock: false 41 | -------------------------------------------------------------------------------- /.github/workflows/add-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Add new bugs & PRs to This Week project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | - transferred 8 | pull_request: 9 | types: 10 | - opened 11 | 12 | jobs: 13 | add-to-project: 14 | name: Add new bugs and PRs to This Week project 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/add-to-project@main 18 | with: 19 | project-url: https://github.com/orgs/Laravel-Backpack/projects/13 20 | github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ 3 | node_modules/ 4 | .DS_Store 5 | .composer.lock 6 | composer.lock 7 | .phpunit.result.cache -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | filter: 2 | paths: 3 | - 'app/*' 4 | - 'src/*' 5 | excluded_paths: 6 | - 'bootstrap/*' 7 | - 'config/*' 8 | - 'public/*' 9 | - 'resources/*' 10 | - 'vendor/*' 11 | - 'views/*' 12 | tools: 13 | php_analyzer: true 14 | php_mess_detector: true 15 | php_changetracking: true 16 | php_code_sniffer: 17 | config: 18 | standard: PSR2 19 | php_loc: 20 | excluded_dirs: 21 | - vendor 22 | php_pdepend: 23 | excluded_dirs: 24 | - vendor 25 | - tests 26 | checks: 27 | php: 28 | code_rating: true 29 | duplication: true 30 | variable_existence: true 31 | useless_calls: true 32 | use_statement_alias_conflict: true 33 | unused_variables: true 34 | unused_properties: true 35 | unused_parameters: true 36 | unused_methods: true 37 | unreachable_code: true 38 | sql_injection_vulnerabilities: true 39 | security_vulnerabilities: true 40 | precedence_mistakes: true 41 | precedence_in_conditions: true 42 | parameter_non_unique: true 43 | no_property_on_interface: true 44 | no_non_implemented_abstract_methods: true 45 | deprecated_code_usage: true 46 | closure_use_not_conflicting: true 47 | closure_use_modifiable: true 48 | avoid_useless_overridden_methods: true 49 | avoid_conflicting_incrementers: true 50 | assignment_of_null_return: true 51 | verify_property_names: true 52 | verify_argument_usable_as_reference: true 53 | verify_access_scope_valid: true 54 | use_self_instead_of_fqcn: true 55 | too_many_arguments: true 56 | symfony_request_injection: true 57 | switch_fallthrough_commented: true 58 | spacing_of_function_arguments: true 59 | spacing_around_non_conditional_operators: true 60 | spacing_around_conditional_operators: true 61 | space_after_cast: true 62 | single_namespace_per_use: true 63 | simplify_boolean_return: true 64 | scope_indentation: 65 | spaces_per_level: '4' 66 | return_doc_comments: true 67 | require_scope_for_properties: true 68 | require_scope_for_methods: true 69 | require_php_tag_first: true 70 | require_braces_around_control_structures: true 71 | remove_trailing_whitespace: true 72 | remove_php_closing_tag: true 73 | remove_extra_empty_lines: true 74 | psr2_switch_declaration: true 75 | psr2_control_structure_declaration: true 76 | psr2_class_declaration: true 77 | property_assignments: true 78 | properties_in_camelcaps: true 79 | prefer_while_loop_over_for_loop: true 80 | phpunit_assertions: true 81 | php5_style_constructor: true 82 | parameters_in_camelcaps: true 83 | parameter_doc_comments: true 84 | return_doc_comment_if_not_inferrable: true 85 | param_doc_comment_if_not_inferrable: true 86 | overriding_private_members: true 87 | optional_parameters_at_the_end: true 88 | one_class_per_file: true 89 | non_commented_empty_catch_block: true 90 | no_unnecessary_if: true 91 | no_unnecessary_function_call_in_for_loop: true 92 | no_unnecessary_final_modifier: true 93 | no_underscore_prefix_in_properties: true 94 | no_underscore_prefix_in_methods: true 95 | no_trailing_whitespace: true 96 | no_space_inside_cast_operator: true 97 | no_space_before_semicolon: true 98 | no_space_around_object_operator: true 99 | no_goto: true 100 | no_global_keyword: true 101 | no_exit: true 102 | no_empty_statements: true 103 | no_else_if_statements: true 104 | no_duplicate_arguments: true 105 | no_debug_code: true 106 | no_commented_out_code: true 107 | newline_at_end_of_file: true 108 | naming_conventions: 109 | local_variable: '^[a-z][a-zA-Z0-9]*$' 110 | abstract_class_name: ^Abstract|Factory$ 111 | utility_class_name: 'Utils?$' 112 | constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$' 113 | property_name: '^[a-z][a-zA-Z0-9]*$' 114 | method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$' 115 | parameter_name: '^[a-z][a-zA-Z0-9]*$' 116 | interface_name: '^[A-Z][a-zA-Z0-9]*Interface$' 117 | type_name: '^[A-Z][a-zA-Z0-9]*$' 118 | exception_name: '^[A-Z][a-zA-Z0-9]*Exception$' 119 | isser_method_name: '^(?:is|has|should|may|supports|was)' 120 | lowercase_php_keywords: true 121 | more_specific_types_in_doc_comments: true 122 | missing_arguments: true 123 | method_calls_on_non_object: true 124 | line_length: 125 | max_length: '120' 126 | lowercase_basic_constants: true 127 | instanceof_class_exists: true 128 | function_in_camel_caps: true 129 | function_body_start_on_new_line: true 130 | fix_use_statements: 131 | remove_unused: true 132 | preserve_multiple: false 133 | preserve_blanklines: false 134 | order_alphabetically: true 135 | foreach_traversable: true 136 | foreach_usable_as_reference: true 137 | fix_php_opening_tag: true 138 | fix_line_ending: true 139 | fix_identation_4spaces: true 140 | fix_doc_comments: true 141 | ensure_lower_case_builtin_functions: true 142 | encourage_postdec_operator: true 143 | classes_in_camel_caps: true 144 | catch_class_exists: true 145 | blank_line_after_namespace_declaration: true 146 | avoid_usage_of_logical_operators: true 147 | avoid_unnecessary_concatenation: true 148 | avoid_tab_indentation: true 149 | avoid_superglobals: true 150 | avoid_perl_style_comments: true 151 | avoid_multiple_statements_on_same_line: true 152 | avoid_fixme_comments: true 153 | avoid_length_functions_in_loops: true 154 | avoid_entity_manager_injection: true 155 | avoid_duplicate_types: true 156 | avoid_corrupting_byteorder_marks: true 157 | argument_type_checks: true 158 | avoid_aliased_php_functions: true 159 | deadlock_detection_in_loops: true -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | preset: laravel 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.1 5 | - 7.2 6 | - 7.3 7 | - 7.4 8 | - 8.0 9 | - nightly 10 | 11 | matrix: 12 | allow_failures: 13 | - php: 7.1 14 | - php: 8.0 15 | - php: nightly 16 | 17 | sudo: false 18 | 19 | install: travis_retry composer install --no-interaction --prefer-source 20 | 21 | script: vendor/bin/phpunit --coverage-clover=coverage.clover 22 | 23 | after_script: 24 | - wget https://scrutinizer-ci.com/ocular.phar 25 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All Notable changes to `MenuCRUD` will be documented in this file. 4 | 5 | Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. 6 | 7 | ------------- 8 | 9 | ## 2.0.5 - 2020-04-24 10 | 11 | ### Added 12 | - support for PageManager 3.x; 13 | 14 | 15 | ## 2.0.4 - 2020-04-24 16 | 17 | ### Added 18 | - support for Backpack 4.1; 19 | 20 | 21 | ## 2.0.3 - 2020-03-05 22 | 23 | ### Fixed 24 | - upgraded PHPUnit; 25 | 26 | 27 | ## 2.0.2 - 2019-10-04 28 | 29 | ### Fixed 30 | - page_or_link field not storing the link; 31 | 32 | 33 | ## 2.0.1 - 2019-09-25 34 | 35 | ### Fixed 36 | - routes not registering sometimes because no fallback was provided to base config variables; 37 | 38 | 39 | ## 2.0.0 - 2019-09-24 40 | 41 | ### Added 42 | - support for Backpack v4; 43 | 44 | ### Removed 45 | - support for Backpack v3; 46 | 47 | ------------- 48 | 49 | 50 | ## 1.0.14 - 2019-09-04 51 | 52 | ### Added 53 | - support for Laravel 6; 54 | 55 | 56 | ## 1.0.13 - 2017-11-29 57 | 58 | ### Added 59 | - package auto-discovery; 60 | 61 | 62 | ## 1.0.12 - 2017-07-06 63 | 64 | ### Fixed 65 | - overwritable routes file; 66 | 67 | 68 | ## 1.0.11 - 2017-07-05 69 | 70 | ### Fixed 71 | - Check for page existence before outputing its URL; 72 | 73 | 74 | ## 1.0.10 - 2017-04-05 75 | 76 | ### Added 77 | - Backpack/PageManager dependency in composer.json; 78 | 79 | 80 | ## 1.0.9 - 2016-10-30 81 | 82 | ### Fixed 83 | - admin prefix now uses the config value from backpack/base; 84 | 85 | 86 | ## 1.0.8 - 2016-07-31 87 | 88 | ### Fixed 89 | - Working bogus unit tests. 90 | 91 | 92 | 93 | ## 1.0.6 - 2016-07-31 94 | 95 | ### Added 96 | - Bogus unit tests. At least we'be able to use travis-ci for requirements errors, until full unit tests are done. 97 | 98 | 99 | ## 1.0.5 - 2016-07-24 100 | 101 | ### Added 102 | - Fixed MenuItem children relationship. 103 | - Switched to the 'admin' middleware for the routes. 104 | 105 | 106 | ## 1.0.4 - 2016-07-23 107 | 108 | ### Added 109 | - Backpack\CRUD 3.0 dependency. 110 | 111 | 112 | ## 1.0.3 - 2016-06-13 113 | 114 | ### Fixed 115 | - Migration file had double extension (.php.php); 116 | 117 | 118 | ## 1.0.2 - 2016-05-26 119 | 120 | ### Fixed 121 | - Renamed to MenuCRUD; 122 | 123 | 124 | ## 1.0.1 - 2016-05-26 125 | 126 | ### Fixed 127 | - Moved routes into MenuManagerServiceProvider so that the package could be easily downloaded from github and pasted over working project. 128 | 129 | 130 | ## 1.0.0 - 2016-05-26 131 | 132 | ### Added 133 | - Initial code. 134 | -------------------------------------------------------------------------------- /CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. 6 | 7 | Examples of unacceptable behavior by participants include: 8 | 9 | * The use of sexualized language or imagery 10 | * Personal attacks 11 | * Trolling or insulting/derogatory comments 12 | * Public or private harassment 13 | * Publishing other's private information, such as physical or electronic addresses, without explicit permission 14 | * Other unethical or unprofessional conduct. 15 | 16 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. 17 | 18 | This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations. 19 | 20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 21 | 22 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) 23 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | We accept contributions via Pull Requests on [Github](https://github.com/laravel-backpack/menucrud). 6 | 7 | 8 | ## Bug Fixing & Enhancements 9 | 10 | We use the Github issue tracker for that. Here's the procedure we've settled upon so 2 people don't work on the same thing: 11 | - you find something that needs doing (say: unit tests for a certain package); 12 | - you check if there is already an issue for it (if there isn't, add one); 13 | - in that issue: 14 | - say you're working on it and it will be done in x hours or y days; 15 | - in that issue, assign the "working on it" label 16 | - assign yourself to the issue; 17 | - then comment/reference the issue in your pull request; 18 | 19 | 20 | ## Pull Requests 21 | 22 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). It's ok to push non-PSR-2 code, but know that [StyleCI](https://styleci.io/) will convert it after the merge. 23 | 24 | - **Document any change in behaviour** - Make sure the `README.md` is still up-to-date with your modifs. 25 | 26 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. 27 | 28 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 29 | 30 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 31 | 32 | 33 | 34 | 35 | ## Running Tests 36 | 37 | The project does NOT have working tests right now, but it really should. If you want to help out, that's one of the most important things you can help with. 38 | 39 | ``` bash 40 | $ composer test 41 | ``` 42 | 43 | 44 | **Happy coding**! 45 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # YUMMY License 2 | 3 | **YoU make Money, I make MoneY.** The license holder is allowed to use the software for free, as long as he doesn't make money by using it. 4 | 5 | Copyright (c) 2015-2017 Cristian Tabacitu 6 | 7 | ## FREE for non-commercial use, PAID for commercial use 8 | 9 | > Permission is hereby granted to any person obtaining a copy of this software 10 | > and associated documentation files (the "Software"), to use the Software. 11 | > This includes the rights to use, copy, modify and/or merge the Sofware 12 | > or copies of the Software, and to permit persons to whom the Software is 13 | > furnished to do so, subject to the following conditions: 14 | > 15 | > **1. Should the Sofware be used for non-commercial purposes (personal use, not-profits, 16 | > testing, education), no financial reward is expected and the above rights are given FREE OF CHARGE.** 17 | > 18 | > **2. Should the Software be used for commercial purposes (the user of this Sofware, 19 | > its employer, employees or clients make money by using this Software), the user is 20 | > required to purchase a "Single Domain License" on [backpackforlaravel.com](https://backpackforlaravel.com), for each 21 | > domain name this sofware will be used on, before its usage in production. 22 | > Failure to do so will constitute as illegal commercial use.** 23 | > 24 | > **3. This license does not include the rights to publish or sublicense 25 | > this Sofware, its copies or any derivations, with or without the purpose of commercial profit. 26 | > For inclusion in commercial packages or SaaS products, an "Unlimited License" is required, which can be purchased on [backpackforlaravel.com](https://backpackforlaravel.com). For inclusion in free open-source packages, express permission is needed from .** 27 | > 28 | > **4. The above copyright notice and this permission notice shall be included in 29 | > all copies or substantial portions of the Software.** 30 | > 31 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | > THE SOFTWARE. 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Backpack\MenuCRUD 2 | 3 | [![Latest Version on Packagist][ico-version]][link-packagist] 4 | [![Software License][ico-license]](LICENSE.md) 5 | [![Build Status][ico-travis]][link-travis] 6 | [![Coverage Status][ico-scrutinizer]][link-scrutinizer] 7 | [![Quality Score][ico-code-quality]][link-code-quality] 8 | [![Total Downloads][ico-downloads]][link-downloads] 9 | 10 | An admin panel for menu items on Laravel 5 or Laravel 6, using [Backpack\CRUD](https://github.com/Laravel-Backpack/crud). Add, edit, reorder, nest, rename menu items and link them to [Backpack\PageManager](https://github.com/Laravel-Backpack/pagemanager) pages, external link or custom internal link. 11 | 12 | Usually used for front-end menus, not back-end. Adding a menu item in MenuCRUD will not add an item in the admin sidebar, though you can easily customize Backpack\Base's ```sidebar.blade.php``` to show all menu items in the db, if you'd like. 13 | 14 | 15 | > ### Security updates and breaking changes 16 | > Please **[subscribe to the Backpack Newsletter](http://backpackforlaravel.com/newsletter)** so you can find out about any security updates, breaking changes or major features. We send an email every 1-2 months. 17 | 18 | 19 | ## Install 20 | 21 | This needs [Backpack\PageManager](https://github.com/Laravel-Backpack/pagemanager) to be installed first. If you haven't already, please do that first. 22 | 23 | Since MenuCRUD is just a Backpack\CRUD example, you can choose to install it one of two ways. 24 | 25 | **(A) Download and place files in your application** (recommended) 26 | 27 | or 28 | 29 | **(B) As a package** 30 | 31 | The only PRO of installing it as a package is that you may benefit from updates. But the reality is there is very little (if any) bug fixing to do, so you probably won't need to update it, ever. 32 | 33 | 34 | 35 | #### Installation type (A) - download 36 | 37 | 38 | 1) [Download the latest build](https://github.com/Laravel-Backpack/MenuCRUD/archive/master.zip). 39 | 40 | 2) Paste the 'app' and 'database' folders over your projects (merge them). No file overwrite warnings should come up. 41 | 42 | 3) Copy the `page_or_link.blade.php` file located in 'resources/views/fields' folder to your project's 'resources/views/vendor/backpack/crud/fields' folder. No file overwrite warnings should come up. 43 | 44 | 4) Replace all mentions of 'Backpack\MenuCRUD\app' in the pasted files with your application's namespace ('App' if you haven't changed it): 45 | - app/Http/Controllers/Admin/MenuItemCrudController.php 46 | - app/Models/MenuItem.php 47 | 48 | 5) Run the migration to have the database table we need: 49 | ``` 50 | php artisan migrate 51 | ``` 52 | 53 | 6) Add MenuCRUD to your routes file: 54 | 55 | ``` 56 | Route::group(['prefix' => config('backpack.base.route_prefix', 'admin'), 'middleware' => ['web', 'auth'], 'namespace' => 'Admin'], function () { 57 | // Backpack\MenuCRUD 58 | Route::crud('menu-item', 'MenuItemCrudController'); 59 | }); 60 | ``` 61 | 62 | 7) [optional] Add a menu item for it: 63 | 64 | ``` 65 | # For Backpack v6 66 | php artisan backpack:add-menu-content "" 67 | # For Backpack v5 or v4 68 | php artisan backpack:add-sidebar-content "" 69 | ``` 70 | 71 | 72 | 73 | #### Installation type (B) - package 74 | 75 | 1) In your terminal, run: 76 | 77 | ``` bash 78 | composer require backpack/menucrud 79 | ``` 80 | 81 | 2) Publish the migration: 82 | 83 | ``` 84 | php artisan vendor:publish --provider="Backpack\MenuCRUD\MenuCRUDServiceProvider" 85 | ``` 86 | 87 | 3) Run the migration to have the database table we need: 88 | 89 | ``` 90 | php artisan migrate 91 | ``` 92 | 93 | 4) [optional] Add a menu item for it: 94 | 95 | ``` 96 | # For Backpack v6 97 | php artisan backpack:add-menu-content "" 98 | # For Backpack v5 or v4 99 | php artisan backpack:add-sidebar-content "" 100 | ``` 101 | 102 | #### Usage in your template 103 | 104 | Here's a simple example to use in your frontend: 105 | 106 | You can access item children with `$item->children` 107 | 108 | ``` 109 | @foreach (\App\MenuItem::getTree(); as $item) 110 | 112 | {{ $item->name }} 113 | 114 | @endforeach 115 | ``` 116 | 117 | For Installation type (B), change the namespace to `Backpack\MenuCRUD\app\Models`. 118 | 119 | ## Change log 120 | 121 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 122 | 123 | ## Overwriting functionality 124 | 125 | If you've used installation type A and need to modify how this works in a project: 126 | - create a ```routes/backpack/menucrud.php``` file; the package will see that, and load _your_ routes file, instead of the one in the package; 127 | - create controllers/models that extend the ones in the package, and use those in your new routes file; 128 | - modify anything you'd like in the new controllers/models; 129 | 130 | ## Contributing 131 | 132 | Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. 133 | 134 | ## Security 135 | 136 | If you discover any security related issues, please email tabacitu@backpackforlaravel.com instead of using the issue tracker. 137 | 138 | Please **[subscribe to the Backpack Newsletter](http://backpackforlaravel.com/newsletter)** so you can find out about any security updates, breaking changes or major features. We send an email every 1-2 months. 139 | 140 | ## Credits 141 | 142 | - [Cristian Tabacitu][link-author] 143 | - [All Contributors][link-contributors] 144 | 145 | ## License 146 | 147 | Backpack is free for non-commercial use and 49 EUR/project for commercial use. Please see [License File](LICENSE.md) and [backpackforlaravel.com](https://backpackforlaravel.com/#pricing) for more information. 148 | 149 | ## Hire us 150 | 151 | We've spend more than 10.000 hours creating, polishing and maintaining administration panels on Laravel. We've developed e-Commerce, e-Learning, ERPs, social networks, payment gateways and much more. We've worked on admin panels _so much_, that we've created one of the most popular software in its niche - just from making public what was repetitive in our projects. 152 | 153 | If you are looking for a developer/team to help you build an admin panel on Laravel, look no further. You'll have a difficult time finding someone with more experience & enthusiasm for this. This is _what we do_. [Contact us - let's see if we can work together](https://backpackforlaravel.com/need-freelancer-or-development-team). 154 | 155 | 156 | [ico-version]: https://img.shields.io/packagist/v/backpack/MenuCRUD.svg?style=flat-square 157 | [ico-license]: https://img.shields.io/badge/license-dual-blue?style=flat-square 158 | [ico-travis]: https://img.shields.io/travis/com/laravel-backpack/menucrud 159 | [ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/Laravel-Backpack/MenuCRUD.svg?style=flat-square 160 | [ico-code-quality]: https://img.shields.io/scrutinizer/g/Laravel-Backpack/MenuCRUD.svg?style=flat-square 161 | [ico-downloads]: https://img.shields.io/packagist/dt/backpack/MenuCRUD.svg?style=flat-square 162 | 163 | [link-packagist]: https://packagist.org/packages/backpack/MenuCRUD 164 | [link-travis]: https://travis-ci.org/Laravel-Backpack/MenuCRUD 165 | [link-scrutinizer]: https://scrutinizer-ci.com/g/Laravel-Backpack/MenuCRUD/code-structure 166 | [link-code-quality]: https://scrutinizer-ci.com/g/Laravel-Backpack/MenuCRUD 167 | [link-downloads]: https://packagist.org/packages/backpack/MenuCRUD 168 | [link-author]: https://github.com/tabacitu 169 | [link-contributors]: ../../contributors 170 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backpack/menucrud", 3 | "type": "library", 4 | "description": "An admin panel for menu items, using Backpack\\CRUD on Laravel 6.", 5 | "keywords": [ 6 | "backpack", 7 | "MenuCRUD" 8 | ], 9 | "homepage": "https://github.com/backpack/MenuCRUD", 10 | "license": "proprietary", 11 | "authors": [ 12 | { 13 | "name": "Cristian Tabacitu", 14 | "email": "tabacitu@backpackforlaravel.com", 15 | "homepage": "https://backpackforlaravel.com", 16 | "role": "Lead Developer" 17 | } 18 | ], 19 | "minimum-stability": "dev", 20 | "prefer-stable": true, 21 | "require": { 22 | "backpack/crud": "^6.0", 23 | "backpack/pagemanager": "^3.2" 24 | }, 25 | "require-dev": { 26 | "scrutinizer/ocular": "~1.1", 27 | "squizlabs/php_codesniffer": "~2.3 || ~3.0" 28 | }, 29 | "autoload": { 30 | "psr-4": { 31 | "Backpack\\MenuCRUD\\": "src" 32 | } 33 | }, 34 | "extra": { 35 | "branch-alias": { 36 | "dev-master": "1.0-dev" 37 | }, 38 | "laravel": { 39 | "providers": [ 40 | "Backpack\\MenuCRUD\\MenuCRUDServiceProvider" 41 | ] 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MenuCRUDServiceProvider.php: -------------------------------------------------------------------------------- 1 | publishes([__DIR__.'/resources/views' => base_path('resources/views/vendor/backpack/crud')], 'views'); 33 | // publish migrations 34 | $this->publishes([__DIR__.'/database/migrations' => database_path('migrations')], 'migrations'); 35 | 36 | $this->loadViewsFrom(realpath(__DIR__.'/resources/views'), 'menucrud'); 37 | } 38 | 39 | /** 40 | * Define the routes for the application. 41 | * 42 | * @param \Illuminate\Routing\Router $router 43 | * @return void 44 | */ 45 | public function setupRoutes(Router $router) 46 | { 47 | // by default, use the routes file provided in vendor 48 | $routeFilePathInUse = __DIR__.$this->routeFilePath; 49 | 50 | // but if there's a file with the same name in routes/backpack, use that one 51 | if (file_exists(base_path().$this->routeFilePath)) { 52 | $routeFilePathInUse = base_path().$this->routeFilePath; 53 | } 54 | 55 | $this->loadRoutesFrom($routeFilePathInUse); 56 | } 57 | 58 | /** 59 | * Register any package services. 60 | * 61 | * @return void 62 | */ 63 | public function register() 64 | { 65 | $this->setupRoutes($this->app->router); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/app/Http/Controllers/Admin/MenuItemCrudController.php: -------------------------------------------------------------------------------- 1 | crud->setModel("Backpack\MenuCRUD\app\Models\MenuItem"); 18 | $this->crud->setRoute(config('backpack.base.route_prefix').'/menu-item'); 19 | $this->crud->setEntityNameStrings('menu item', 'menu items'); 20 | 21 | $this->crud->enableReorder('name', 3); 22 | 23 | $this->crud->operation('list', function () { 24 | $this->crud->addColumn([ 25 | 'name' => 'name', 26 | 'label' => 'Label', 27 | ]); 28 | $this->crud->addColumn([ 29 | 'label' => 'Parent', 30 | 'type' => 'select', 31 | 'name' => 'parent_id', 32 | 'entity' => 'parent', 33 | 'attribute' => 'name', 34 | 'model' => "\Backpack\MenuCRUD\app\Models\MenuItem", 35 | ]); 36 | }); 37 | 38 | $this->crud->operation(['create', 'update'], function () { 39 | $this->crud->addField([ 40 | 'name' => 'name', 41 | 'label' => 'Label', 42 | ]); 43 | $this->crud->addField([ 44 | 'label' => 'Parent', 45 | 'type' => 'select', 46 | 'name' => 'parent_id', 47 | 'entity' => 'parent', 48 | 'attribute' => 'name', 49 | 'model' => "\Backpack\MenuCRUD\app\Models\MenuItem", 50 | ]); 51 | $this->crud->addField([ 52 | 'name' => 'type,link,page_id', 53 | 'label' => 'Type', 54 | 'type' => 'page_or_link', 55 | 'page_model' => '\Backpack\PageManager\app\Models\Page', 56 | 'view_namespace' => file_exists(resource_path('views/vendor/backpack/crud/fields/page_or_link.blade.php')) ? null : 'menucrud::fields', 57 | ]); 58 | }); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/app/Models/MenuItem.php: -------------------------------------------------------------------------------- 1 | belongsTo('Backpack\MenuCRUD\app\Models\MenuItem', 'parent_id'); 18 | } 19 | 20 | public function children() 21 | { 22 | return $this->hasMany('Backpack\MenuCRUD\app\Models\MenuItem', 'parent_id'); 23 | } 24 | 25 | public function page() 26 | { 27 | return $this->belongsTo('Backpack\PageManager\app\Models\Page', 'page_id'); 28 | } 29 | 30 | /** 31 | * Get all menu items, in a hierarchical collection. 32 | * Only supports 2 levels of indentation. 33 | */ 34 | public static function getTree() 35 | { 36 | $menu = self::orderBy('lft')->get(); 37 | 38 | if ($menu->count()) { 39 | foreach ($menu as $k => $menu_item) { 40 | $menu_item->children = collect([]); 41 | 42 | foreach ($menu as $i => $menu_subitem) { 43 | if ($menu_subitem->parent_id == $menu_item->id) { 44 | $menu_item->children->push($menu_subitem); 45 | 46 | // remove the subitem for the first level 47 | $menu = $menu->reject(function ($item) use ($menu_subitem) { 48 | return $item->id == $menu_subitem->id; 49 | }); 50 | } 51 | } 52 | } 53 | } 54 | 55 | return $menu; 56 | } 57 | 58 | public function url() 59 | { 60 | switch ($this->type) { 61 | case 'external_link': 62 | return $this->link; 63 | 64 | case 'internal_link': 65 | return is_null($this->link) ? '#' : url($this->link); 66 | 67 | default: //page_link 68 | if ($this->page) { 69 | return url($this->page->slug); 70 | } 71 | break; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/database/migrations/2016_05_05_115641_create_menu_items_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name', 100); 18 | $table->string('type', 20)->nullable(); 19 | $table->string('link', 255)->nullable(); 20 | $table->integer('page_id')->unsigned()->nullable(); 21 | $table->integer('parent_id')->unsigned()->nullable(); 22 | $table->integer('lft')->unsigned()->nullable(); 23 | $table->integer('rgt')->unsigned()->nullable(); 24 | $table->integer('depth')->unsigned()->nullable(); 25 | $table->timestamps(); 26 | $table->softDeletes(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::drop('menu_items'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/resources/views/fields/page_or_link.blade.php: -------------------------------------------------------------------------------- 1 | {{-- PAGE OR LINK field --}} 2 | {{-- Used in Backpack\MenuCRUD --}} 3 | 4 | 19 | 20 | @include('crud::fields.inc.wrapper_start') 21 | 22 | @include('crud::fields.inc.translatable_icon') 23 | 24 |
25 | {{-- hidden placeholders for content --}} 26 | 27 | 28 | 29 |
30 | {{-- type select --}} 31 | 49 |
50 |
51 | {{-- page slug input --}} 52 | @php 53 | $shouldShowPageLink = (isset($entry) && $entry->{$field['configurationNames']['type']} === 'page_link') || 54 | (isset($entry) && !$entry->{$field['configurationNames']['type']} && !$field['allows_null']) || 55 | (!isset($entry) && !$field['allows_null']); 56 | 57 | @endphp 58 | 73 | 74 | {{-- internal link input --}} 75 | @php 76 | $shouldShowInternalLink = isset($entry) && $entry->{$field['configurationNames']['type']} === 'internal_link'; 77 | @endphp 78 | 98 | 99 | {{-- external link input --}} 100 | @php 101 | $shouldShowExternalLink = isset($entry) && $entry->{$field['configurationNames']['type']} === 'external_link'; 102 | @endphp 103 | 123 |
124 |
125 | 126 | {{-- HINT --}} 127 | @if (isset($field['hint'])) 128 |

{!! $field['hint'] !!}

129 | @endif 130 | 131 | @include('crud::fields.inc.wrapper_end') 132 | 133 | 134 | {{-- ########################################## --}} 135 | {{-- Extra CSS and JS for this particular field --}} 136 | {{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} 137 | @if ($crud->fieldTypeNotLoaded($field)) 138 | @php 139 | $crud->markFieldTypeAsLoaded($field); 140 | @endphp 141 | 142 | {{-- FIELD JS - will be loaded in the after_scripts section --}} 143 | @push('crud_fields_scripts') 144 | 178 | @endpush 179 | 180 | @endif 181 | {{-- End of Extra CSS and JS --}} 182 | {{-- ########################################## --}} -------------------------------------------------------------------------------- /src/routes/backpack/menucrud.php: -------------------------------------------------------------------------------- 1 | config('backpack.base.route_prefix', 'admin'), 15 | 'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], 16 | 'namespace' => 'Backpack\MenuCRUD\app\Http\Controllers\Admin', 17 | ], function () { 18 | Route::crud('menu-item', 'MenuItemCrudController'); 19 | }); 20 | --------------------------------------------------------------------------------