├── .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 ├── phpunit.xml ├── src ├── PageManagerServiceProvider.php ├── app │ ├── Http │ │ ├── Controllers │ │ │ └── Admin │ │ │ │ └── PageCrudController.php │ │ └── Requests │ │ │ └── PageRequest.php │ ├── Models │ │ └── Page.php │ └── PageTemplates.php ├── config │ └── pagemanager.php ├── database │ └── migrations │ │ ├── 2016_05_25_121918_create_pages_table.php │ │ └── 2017_04_10_195926_change_extras_to_longtext.php ├── resources │ ├── lang │ │ ├── ar │ │ │ └── pagemanager.php │ │ ├── da_DK │ │ │ └── pagemanager.php │ │ ├── de │ │ │ └── pagemanager.php │ │ ├── en │ │ │ └── pagemanager.php │ │ ├── es │ │ │ └── pagemanager.php │ │ ├── fa │ │ │ └── pagemanager.php │ │ ├── fr │ │ │ └── pagemanager.php │ │ ├── id │ │ │ └── pagemanager.php │ │ ├── it │ │ │ └── pagemanager.php │ │ ├── nl │ │ │ └── pagemanager.php │ │ ├── pt │ │ │ └── pagemanager.php │ │ ├── ru │ │ │ └── pagemanager.php │ │ ├── tr │ │ │ └── pagemanager.php │ │ ├── uk │ │ │ └── pagemanager.php │ │ └── vi │ │ │ └── pagemanager.php │ └── views │ │ └── vendor │ │ └── backpack │ │ └── crud │ │ └── fields │ │ └── select_page_template.blade.php └── routes │ └── backpack │ └── pagemanager.php └── tests └── BaseTest.php /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laravel-Backpack/PageManager/4f14448cb38e93cc1a02381568bc45f0ac38e5f7/.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: '$NEXT_PATCH_VERSION 🌈' 19 | tag-template: '$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 | $CHANGES 42 | 43 | -------------------------------------------------------------------------------- /.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 | external_code_coverage: true 14 | php_analyzer: true 15 | php_mess_detector: true 16 | php_changetracking: true 17 | php_code_sniffer: 18 | config: 19 | standard: PSR2 20 | php_loc: 21 | excluded_dirs: 22 | - vendor 23 | php_pdepend: 24 | excluded_dirs: 25 | - vendor 26 | - tests 27 | checks: 28 | php: 29 | code_rating: true 30 | duplication: true 31 | variable_existence: true 32 | useless_calls: true 33 | use_statement_alias_conflict: true 34 | unused_variables: true 35 | unused_properties: true 36 | unused_parameters: true 37 | unused_methods: true 38 | unreachable_code: true 39 | sql_injection_vulnerabilities: true 40 | security_vulnerabilities: true 41 | precedence_mistakes: true 42 | precedence_in_conditions: true 43 | parameter_non_unique: true 44 | no_property_on_interface: true 45 | no_non_implemented_abstract_methods: true 46 | deprecated_code_usage: true 47 | closure_use_not_conflicting: true 48 | closure_use_modifiable: true 49 | avoid_useless_overridden_methods: true 50 | avoid_conflicting_incrementers: true 51 | assignment_of_null_return: true 52 | verify_property_names: true 53 | verify_argument_usable_as_reference: true 54 | verify_access_scope_valid: true 55 | use_self_instead_of_fqcn: true 56 | too_many_arguments: true 57 | symfony_request_injection: true 58 | switch_fallthrough_commented: true 59 | spacing_of_function_arguments: true 60 | spacing_around_non_conditional_operators: true 61 | spacing_around_conditional_operators: true 62 | space_after_cast: true 63 | single_namespace_per_use: true 64 | simplify_boolean_return: true 65 | scope_indentation: 66 | spaces_per_level: '4' 67 | return_doc_comments: true 68 | require_scope_for_properties: true 69 | require_scope_for_methods: true 70 | require_php_tag_first: true 71 | require_braces_around_control_structures: true 72 | remove_trailing_whitespace: true 73 | remove_php_closing_tag: true 74 | remove_extra_empty_lines: true 75 | psr2_switch_declaration: true 76 | psr2_control_structure_declaration: true 77 | psr2_class_declaration: true 78 | property_assignments: true 79 | properties_in_camelcaps: true 80 | prefer_while_loop_over_for_loop: true 81 | phpunit_assertions: true 82 | php5_style_constructor: true 83 | parameters_in_camelcaps: true 84 | parameter_doc_comments: true 85 | return_doc_comment_if_not_inferrable: true 86 | param_doc_comment_if_not_inferrable: true 87 | overriding_private_members: true 88 | optional_parameters_at_the_end: true 89 | one_class_per_file: true 90 | non_commented_empty_catch_block: true 91 | no_unnecessary_if: true 92 | no_unnecessary_function_call_in_for_loop: true 93 | no_unnecessary_final_modifier: true 94 | no_underscore_prefix_in_properties: true 95 | no_underscore_prefix_in_methods: true 96 | no_trailing_whitespace: true 97 | no_space_inside_cast_operator: true 98 | no_space_before_semicolon: true 99 | no_space_around_object_operator: true 100 | no_goto: true 101 | no_global_keyword: true 102 | no_exit: true 103 | no_empty_statements: true 104 | no_else_if_statements: true 105 | no_duplicate_arguments: true 106 | no_debug_code: true 107 | no_commented_out_code: true 108 | newline_at_end_of_file: true 109 | naming_conventions: 110 | local_variable: '^[a-z][a-zA-Z0-9]*$' 111 | abstract_class_name: ^Abstract|Factory$ 112 | utility_class_name: 'Utils?$' 113 | constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$' 114 | property_name: '^[a-z][a-zA-Z0-9]*$' 115 | method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$' 116 | parameter_name: '^[a-z][a-zA-Z0-9]*$' 117 | interface_name: '^[A-Z][a-zA-Z0-9]*Interface$' 118 | type_name: '^[A-Z][a-zA-Z0-9]*$' 119 | exception_name: '^[A-Z][a-zA-Z0-9]*Exception$' 120 | isser_method_name: '^(?:is|has|should|may|supports|was)' 121 | lowercase_php_keywords: true 122 | more_specific_types_in_doc_comments: true 123 | missing_arguments: true 124 | method_calls_on_non_object: true 125 | line_length: 126 | max_length: '120' 127 | lowercase_basic_constants: true 128 | instanceof_class_exists: true 129 | function_in_camel_caps: true 130 | function_body_start_on_new_line: true 131 | fix_use_statements: 132 | remove_unused: true 133 | preserve_multiple: false 134 | preserve_blanklines: false 135 | order_alphabetically: true 136 | foreach_traversable: true 137 | foreach_usable_as_reference: true 138 | fix_php_opening_tag: true 139 | fix_line_ending: true 140 | fix_identation_4spaces: true 141 | fix_doc_comments: true 142 | ensure_lower_case_builtin_functions: true 143 | encourage_postdec_operator: true 144 | classes_in_camel_caps: true 145 | catch_class_exists: true 146 | blank_line_after_namespace_declaration: true 147 | avoid_usage_of_logical_operators: true 148 | avoid_unnecessary_concatenation: true 149 | avoid_tab_indentation: true 150 | avoid_superglobals: true 151 | avoid_perl_style_comments: true 152 | avoid_multiple_statements_on_same_line: true 153 | avoid_fixme_comments: true 154 | avoid_length_functions_in_loops: true 155 | avoid_entity_manager_injection: true 156 | avoid_duplicate_types: true 157 | avoid_corrupting_byteorder_marks: true 158 | argument_type_checks: true 159 | avoid_aliased_php_functions: true 160 | deadlock_detection_in_loops: true 161 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | preset: laravel 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.2.5 5 | - 7.3 6 | - 7.4 7 | - 8.0 8 | - nightly 9 | 10 | matrix: 11 | allow_failures: 12 | - php: 8.0 13 | - php: nightly 14 | 15 | sudo: false 16 | 17 | install: travis_retry composer install --no-interaction --prefer-source 18 | 19 | script: vendor/bin/phpunit --coverage-clover=coverage.clover 20 | 21 | after_script: 22 | - wget https://scrutinizer-ci.com/ocular.phar 23 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All Notable changes to `BackPack\PageManager` will be documented in this file. 4 | 5 | Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. 6 | 7 | ------ 8 | IMPORTANT 9 | ------ 10 | 11 | We no longer use this file to track changes. Please see our repo's "Releases" tab, on Github: 12 | https://github.com/Laravel-Backpack/PageManager/releases 13 | 14 | ------ 15 | 16 | ## 3.0.0 - 2020-05-06 17 | 18 | ### Added 19 | - support for Backpack 4.1; 20 | 21 | ### Removed 22 | - support for Backpack 4.0; 23 | - laravel/helpers dependency; 24 | 25 | 26 | ------ 27 | 28 | 29 | ## 2.0.7 - 2020-03-05 30 | 31 | ### Fixed 32 | - upgraded PHPUnit to 9 or 7; 33 | 34 | 35 | ## 2.0.6 - 2020-03-05 36 | 37 | ### Added 38 | - support for Laravel 7; 39 | 40 | 41 | ## 2.0.5 - 2020-01-14 42 | 43 | ### Added 44 | - merged #101 - added Indonesian language file; 45 | 46 | 47 | ## 2.0.4 - 2019-12-19 48 | 49 | ### Added 50 | - Farsi (Persian) language file; 51 | 52 | 53 | ## 2.0.3 - 2019-12-17 54 | 55 | ### Fixed 56 | - fixed #98 - allow installation on Backpack 4.0 on Laravel 5.8; 57 | 58 | 59 | ## 2.0.2 - 2019-11-17 60 | 61 | ### Added 62 | - Russian language translation; 63 | 64 | 65 | ## 2.0.1 - 2019-10-04 66 | 67 | ### Added 68 | - extras is cast as array on the Page model; 69 | 70 | 71 | ## 2.0.0 - 2019-09-24 72 | 73 | ### Added 74 | - Backpack v4 support; 75 | 76 | ### Removed 77 | - Backpack v3 support; 78 | 79 | ------ 80 | 81 | 82 | ## 1.1.29 - 2019-09-04 83 | 84 | ### Added 85 | - Laravel 6 support; 86 | 87 | 88 | ## 1.1.28 - 2019-02-27 89 | 90 | ### Fixed 91 | - #79, merged #81 - changing template on Create page; 92 | 93 | ## 1.1.27 - 2018-12-06 94 | 95 | ### Fixed 96 | - #75 - using old version of select_page_template field; 97 | 98 | 99 | ## 1.1.26 - 2018-11-16 100 | 101 | ### Fixed 102 | - #73 - hotfix; 103 | 104 | ## 1.1.25 - 2018-11-16 105 | 106 | ### Fixed 107 | - #73 - converting template method name to a readable name stripped characters in some instances; 108 | 109 | ## 1.1.24 - 2018-10-16 110 | 111 | ### Added 112 | - PT translation; 113 | - merged #70 - using custom Backpack guard as defined by ```backpack_auth()```; 114 | - put PageManager panel behind standard Backpack middleware (defined in Base config file); 115 | 116 | ## 1.1.23 - 2018-03-13 117 | 118 | ### Added 119 | - FR, DE and NL translations; 120 | 121 | 122 | ## 1.1.22 - 2017-11-02 123 | 124 | ### Added 125 | - search route for CRUD 3.3 upgrade; 126 | 127 | 128 | ## 1.1.21 - 2017-08-30 129 | 130 | ### Added 131 | - package autodiscovery for Laravel 5.5; 132 | 133 | 134 | ## 1.1.20 - 2017-08-11 135 | 136 | ### Added 137 | - Danish (da_DK) language files, thanks to [Frederik Rabøl](https://github.com/Xayer); 138 | 139 | 140 | ## 1.1.19 - 2017-07-18 141 | 142 | ### Added 143 | - language file support and EN and IT language files, thanks to [Federico Liva](https://github.com/fede91it); 144 | 145 | 146 | ## 1.1.18 - 2017-07-06 147 | 148 | ### Added 149 | - overwritable routes file; 150 | 151 | ### Fixed 152 | - versioning accidentaly jumped to 1.1.17; 153 | 154 | ## 1.1.10 - 2017-07-05 155 | 156 | ### Fixed 157 | - prettier error message when template has been deleted; 158 | - filterable getTemplates() method, using reflection; 159 | 160 | 161 | ## 1.1.9 - 2017-04-18 162 | 163 | ### Fixed 164 | - longText extras column; 165 | 166 | 167 | ## 1.1.8 - 2017-04-11 168 | 169 | ### Fixed 170 | - lowercase app namespace everywhere; 171 | 172 | 173 | ## 1.1.7 - 2017-04-06 174 | 175 | ### Fixed 176 | - class does not exist issue, because of lowercase app in configured namespace; 177 | 178 | ## 1.1.6 - 2017-04-05 179 | 180 | ### Fixed 181 | - moved pagemanager.php config file to the backpack folder; 182 | 183 | 184 | ## 1.1.5 - 2017-04-05 185 | 186 | ### Fixed 187 | - creating pages with no slugs; 188 | 189 | 190 | ## 1.1.4 - 2017-04-05 191 | 192 | ### Added 193 | - ability to easily extend the Controller or Model (thanks to [Carl Olsen](https://github.com/unstoppablecarl)); 194 | 195 | 196 | ## 1.1.3 - 2016-10-30 197 | 198 | ### Fixed 199 | - Routes now follow the route_prefix set in config, with an "admin" default; 200 | 201 | 202 | ## 1.1.2 - 2016-10-12 203 | 204 | ### Fixed 205 | - Routes now follow the route_prefix set in config; 206 | 207 | 208 | ## 1.1.1 - 2016-09-12 209 | 210 | ### Added 211 | - Page model uses eloquent-sluggable trait for fetching items by slug. 212 | - Example front-end code. 213 | 214 | 215 | ## 1.1.0 - 2016-08-31 216 | 217 | ### Added 218 | - Eloquent-sluggable version 4. 219 | 220 | 221 | ## 1.0.9 - 2016-07-31 222 | 223 | ### Fixed 224 | - Working bogus unit tests. 225 | 226 | 227 | ## 1.0.8 - 2016-07-31 228 | 229 | ### Added 230 | - Bogus unit tests. At least we'be able to use travis-ci for requirements errors, until full unit tests are done. 231 | 232 | 233 | ## 1.0.7 - 2016-07-24 234 | 235 | ### Fixed 236 | - fixed select_page_template field; 237 | - changed template and page_name fields to col-md-6; 238 | - changed Preview column with Open button; 239 | 240 | 241 | ## 1.0.6 - 2016-07-23 242 | 243 | ### Added 244 | - Required CRUD 3.0 245 | 246 | 247 | ## 1.0.5 - 2016-06-03 248 | 249 | ### Fixed 250 | - Additional methods on PageCrudController are now public instead of private, so PageCrudController can more easily be extended. 251 | 252 | 253 | ## 1.0.4 - 2016-06-02 254 | 255 | ### Fixed 256 | - Using the Admin middleware instead of Auth, as of Backpack\Base v0.6.0; 257 | - Moved routes definition to PageManagerServiceProvider; 258 | 259 | 260 | ## 1.0.3 - 2016-06-01 261 | 262 | ### Fixed 263 | - Slug wasn't generated from title, but name. 264 | 265 | 266 | ## 1.0.2 - 2016-05-25 267 | 268 | ### Fixed 269 | - Added Backpack\CRUD requirement in composer.json 270 | 271 | 272 | ## 1.0.1 - 2016-05-25 273 | 274 | ### Fixed 275 | - composer.json 276 | 277 | 278 | ## 1.0.0 - 2016-05-25 279 | 280 | ### Added 281 | - Basic functionality. 282 | -------------------------------------------------------------------------------- /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/pagemanager). 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\PageManager 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 | 11 | An interface to let your admins add and edit presentation pages to your Laravel 6, 7, 8, 9, 10, 11 or 12 website, by defining page templates with any number of content areas and any number of content types. Uses [Laravel Backpack](https://github.com/laravel-backpack). 12 | 13 | ![Backpack PageManager edit page](https://user-images.githubusercontent.com/1032474/106446854-6dc73100-6489-11eb-9e4c-b21273cef23e.png "PageManager edit page") 14 | 15 | 16 | > ### Security updates and breaking changes 17 | > 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. 18 | 19 | 20 | ## Install 21 | 22 | 1) Add a file to define your page templates in ```app/PageTemplates.php```: 23 | ```php 24 | crud->addField([ // CustomHTML 49 | 'name' => 'metas_separator', 50 | 'type' => 'custom_html', 51 | 'value' => '

'.trans('backpack::pagemanager.metas').'


', 52 | ]); 53 | $this->crud->addField([ 54 | 'name' => 'meta_title', 55 | 'label' => trans('backpack::pagemanager.meta_title'), 56 | 'fake' => true, 57 | 'store_in' => 'extras', 58 | ]); 59 | $this->crud->addField([ 60 | 'name' => 'meta_description', 61 | 'label' => trans('backpack::pagemanager.meta_description'), 62 | 'fake' => true, 63 | 'store_in' => 'extras', 64 | ]); 65 | $this->crud->addField([ 66 | 'name' => 'meta_keywords', 67 | 'type' => 'textarea', 68 | 'label' => trans('backpack::pagemanager.meta_keywords'), 69 | 'fake' => true, 70 | 'store_in' => 'extras', 71 | ]); 72 | $this->crud->addField([ // CustomHTML 73 | 'name' => 'content_separator', 74 | 'type' => 'custom_html', 75 | 'value' => '

'.trans('backpack::pagemanager.content').'


', 76 | ]); 77 | $this->crud->addField([ 78 | 'name' => 'content', 79 | 'label' => trans('backpack::pagemanager.content'), 80 | 'type' => 'summernote', 81 | 'placeholder' => trans('backpack::pagemanager.content_placeholder'), 82 | ]); 83 | } 84 | 85 | private function about_us() 86 | { 87 | $this->crud->addField([ 88 | 'name' => 'content', 89 | 'label' => trans('backpack::pagemanager.content'), 90 | 'type' => 'summernote', 91 | 'placeholder' => trans('backpack::pagemanager.content_placeholder'), 92 | ]); 93 | } 94 | } 95 | ``` 96 | 97 | 2) In your terminal 98 | 99 | ``` bash 100 | composer require backpack/pagemanager 101 | ``` 102 | 103 | 3) Publish the views, migrations and the PageTemplates trait: 104 | 105 | ``` 106 | php artisan vendor:publish --provider="Backpack\PageManager\PageManagerServiceProvider" 107 | ``` 108 | 109 | 4) Run the migration to have the database table we need: 110 | 111 | ``` 112 | php artisan migrate 113 | ``` 114 | 115 | 5) [optional] Add a menu item for it: 116 | 117 | ``` 118 | # For Backpack v6 119 | php artisan backpack:add-menu-content "" 120 | # For Backpack v5 or v4 121 | php artisan backpack:add-sidebar-content "" 122 | ``` 123 | 124 | 125 | ## Usage 126 | 127 | 1. Go to **yourapp/admin/page** and see how it works. 128 | 2. Define your own templates in app/PageTemplates.php using the Backpack\CRUD API. 129 | 130 | ## Example front-end 131 | 132 | No front-end is provided (Backpack only takes care of the admin panel), but for most projects this front-end code will be all you need: 133 | 134 | (1) Create a catch-all route at the end of your routes file: 135 | ```php 136 | /** CATCH-ALL ROUTE for Backpack/PageManager - needs to be at the end of your routes.php file **/ 137 | Route::get('{page}/{subs?}', ['uses' => '\App\Http\Controllers\PageController@index']) 138 | ->where(['page' => '^(((?=(?!admin))(?=(?!\/)).))*$', 'subs' => '.*']); 139 | ``` 140 | 141 | (2) Create ```app\Http\Controllers\PageController.php``` that actually shows the page. 142 | ```php 143 | homepage.'); 159 | } 160 | 161 | $this->data['title'] = $page->title; 162 | $this->data['page'] = $page->withFakes(); 163 | 164 | return view('pages.'.$page->template, $this->data); 165 | } 166 | } 167 | ``` 168 | 169 | (3) Create the views for those templates (how those pages actually look - the HTML CSS JS) and place them in your ```resources/views/pages/``` directory. Inside those blade files, you can use the ```$page``` variable. That's where all the page content is stored. For more complicated pages, you can also use [fake fields](https://laravel-backpack.readme.io/docs/crud#section-extras-fake-fields-stored-as-json-in-the-database-) in your page templates. You'll also find those attributes in the ```$page``` variable. 170 | 171 | Note: if you find yourself in need of sending extra data to a view you load on multiple pages, you should consider [using a view composer](https://laravel.com/docs/5.3/views#view-composers); 172 | 173 | ## Extend 174 | 175 | If you need to make any modifications to the controller, model or request, you should: 176 | - make sure ```config/backpack/pagemanager.php``` is published; if not, publish it using ```php artisan vendor:publish --provider="Backpack\PageManager\PageManagerServiceProvider"```; 177 | - create a new controller/model that extends the one in the package; 178 | - enter controller or model in the pagemanager.php config file, and that's the one that the CRUD will be using; 179 | 180 | ## Optional: Mutator for fields using 'store_in' and 'fake' keys 181 | 182 | Fake fields do not trigger individual mutators, they trigger the "fake column" mutator. For example instead of defining a `setImageAttribute()` mutator, please define a `setExtrasAttribute()` mutator. You'll have the `$value` then. 183 | 184 | ## Change log 185 | 186 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 187 | 188 | ## Testing 189 | 190 | ``` bash 191 | $ composer test 192 | ``` 193 | 194 | ## Contributing 195 | 196 | Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. 197 | 198 | ## Overwriting Functionality 199 | 200 | If you need to modify how this works in a project: 201 | - create a ```routes/backpack/pagemanager.php``` file; the package will see that, and load _your_ routes file, instead of the one in the package; 202 | - create controllers/models that extend the ones in the package, and use those in your new routes file; 203 | - modify anything you'd like in the new controllers/models; 204 | 205 | ## Security 206 | 207 | If you discover any security related issues, please email hello@backpackforlaravel.com instead of using the issue tracker. 208 | 209 | ## Credits 210 | 211 | - [Cristian Tabacitu][link-author] 212 | - [All Contributors][link-contributors] 213 | 214 | ## License 215 | 216 | Backpack is free for non-commercial use and 69 EUR/project for commercial use. Please see [License File](LICENSE.md) and [backpackforlaravel.com](https://backpackforlaravel.com/#pricing) for more information. 217 | 218 | ## Hire us 219 | 220 | 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. 221 | 222 | 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). 223 | 224 | [ico-version]: https://img.shields.io/packagist/v/backpack/PageManager.svg?style=flat-square 225 | [ico-license]: https://img.shields.io/badge/license-dual-blue?style=flat-square 226 | [ico-travis]: https://img.shields.io/travis/laravel-backpack/PageManager/master.svg?style=flat-square 227 | [ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/laravel-backpack/PageManager.svg?style=flat-square 228 | [ico-code-quality]: https://img.shields.io/scrutinizer/g/laravel-backpack/PageManager.svg?style=flat-square 229 | [ico-downloads]: https://img.shields.io/packagist/dt/backpack/pagemanager.svg?style=flat-square 230 | 231 | [link-packagist]: https://packagist.org/packages/backpack/pagemanager 232 | [link-travis]: https://travis-ci.org/laravel-backpack/PageManager 233 | [link-scrutinizer]: https://scrutinizer-ci.com/g/laravel-backpack/PageManager/code-structure 234 | [link-code-quality]: https://scrutinizer-ci.com/g/laravel-backpack/PageManager 235 | [link-downloads]: https://packagist.org/packages/backpack/pagemanager 236 | [link-author]: https://github.com/tabacitu 237 | [link-contributors]: ../../contributors 238 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backpack/pagemanager", 3 | "type": "library", 4 | "description": "Create admin panels for presentation websites on Laravel, using page templates and Backpack\\CRUD.", 5 | "keywords": [ 6 | "backpack", 7 | "crud", 8 | "wordpress", 9 | "cms", 10 | "content management system", 11 | "presentation pages", 12 | "presentation website", 13 | "manage pages", 14 | "administer pages", 15 | "pagemanager", 16 | "admin panel" 17 | ], 18 | "homepage": "https://github.com/laravel-backpack/PageManager", 19 | "license": "proprietary", 20 | "authors": [ 21 | { 22 | "name": "Cristian Tabacitu", 23 | "email": "tabacitu@backpackforlaravel.com", 24 | "homepage": "https://backpackforlaravel.com", 25 | "role": "Architect & Developer" 26 | } 27 | ], 28 | "minimum-stability": "dev", 29 | "prefer-stable": true, 30 | "require": { 31 | "backpack/crud": "^4.0||^5.0||^6.0", 32 | "cviebrock/eloquent-sluggable": "^12.0||^11.0||^10.0||^9.0||^8.0||^7.0||^6.0||4.8" 33 | }, 34 | "require-dev": { 35 | "phpunit/phpunit" : "^11.0||^10.0||^9.0||^7.0", 36 | "scrutinizer/ocular": "~1.1", 37 | "squizlabs/php_codesniffer": "~2.3||~3.0" 38 | }, 39 | "autoload": { 40 | "psr-4": { 41 | "Backpack\\PageManager\\": "src" 42 | } 43 | }, 44 | "autoload-dev": { 45 | "psr-4": { 46 | "Backpack\\PageManager\\": "tests" 47 | } 48 | }, 49 | "scripts": { 50 | "test": "vendor/bin/phpunit --testdox" 51 | }, 52 | "extra": { 53 | "branch-alias": { 54 | "dev-master": "1.0-dev" 55 | }, 56 | "laravel": { 57 | "providers": [ 58 | "Backpack\\PageManager\\PageManagerServiceProvider" 59 | ] 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/PageManagerServiceProvider.php: -------------------------------------------------------------------------------- 1 | publishes([__DIR__.'/resources/views' => base_path('resources/views')], 'views'); 33 | // publish PageTemplates trait 34 | $this->publishes([__DIR__.'/app/PageTemplates.php' => app_path('PageTemplates.php')], 'trait'); 35 | // publish migrations 36 | $this->publishes([__DIR__.'/database/migrations' => database_path('migrations')], 'migrations'); 37 | // public config 38 | $this->publishes([__DIR__.'/config/pagemanager.php' => config_path('backpack/pagemanager.php')]); 39 | // public languages 40 | $this->publishes([__DIR__.'/resources/lang' => resource_path('lang/vendor/backpack')], 'lang'); 41 | 42 | $this->mergeConfigFrom(__DIR__.'/config/pagemanager.php', 'backpack.pagemanager'); 43 | $this->loadViewsFrom(realpath(__DIR__.'/resources/views/vendor/backpack/crud'), 'pagemanager'); 44 | } 45 | 46 | /** 47 | * Define the routes for the application. 48 | * 49 | * @param \Illuminate\Routing\Router $router 50 | * @return void 51 | */ 52 | public function setupRoutes(Router $router) 53 | { 54 | // by default, use the routes file provided in vendor 55 | $routeFilePathInUse = __DIR__.$this->routeFilePath; 56 | 57 | // but if there's a file with the same name in routes/backpack, use that one 58 | if (file_exists(base_path().$this->routeFilePath)) { 59 | $routeFilePathInUse = base_path().$this->routeFilePath; 60 | } 61 | 62 | $this->loadRoutesFrom($routeFilePathInUse); 63 | } 64 | 65 | /** 66 | * Register any package services. 67 | * 68 | * @return void 69 | */ 70 | public function register() 71 | { 72 | $this->setupRoutes($this->app->router); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/app/Http/Controllers/Admin/PageCrudController.php: -------------------------------------------------------------------------------- 1 | crud->setModel(config('backpack.pagemanager.page_model_class', 'Backpack\PageManager\app\Models\Page')); 22 | $this->crud->setRoute(config('backpack.base.route_prefix').'/page'); 23 | $this->crud->setEntityNameStrings(trans('backpack::pagemanager.page'), trans('backpack::pagemanager.pages')); 24 | } 25 | 26 | protected function setupListOperation() 27 | { 28 | $this->crud->addColumn([ 29 | 'name' => 'name', 30 | 'label' => trans('backpack::pagemanager.name'), 31 | ]); 32 | $this->crud->addColumn([ 33 | 'name' => 'template', 34 | 'label' => trans('backpack::pagemanager.template'), 35 | 'type' => 'model_function', 36 | 'function_name' => 'getTemplateName', 37 | ]); 38 | $this->crud->addColumn([ 39 | 'name' => 'slug', 40 | 'label' => trans('backpack::pagemanager.slug'), 41 | ]); 42 | $this->crud->addButtonFromModelFunction('line', 'open', 'getOpenButton', 'beginning'); 43 | } 44 | 45 | // ----------------------------------------------- 46 | // Overwrites of CrudController 47 | // ----------------------------------------------- 48 | 49 | protected function setupCreateOperation() 50 | { 51 | // Note: 52 | // - default fields, that all templates are using, are set using $this->addDefaultPageFields(); 53 | // - template-specific fields are set per-template, in the PageTemplates trait; 54 | 55 | $this->addDefaultPageFields(\Request::input('template')); 56 | $this->useTemplate(\Request::input('template')); 57 | 58 | $this->crud->setValidation(PageRequest::class); 59 | } 60 | 61 | protected function setupUpdateOperation() 62 | { 63 | // if the template in the GET parameter is missing, figure it out from the db 64 | $template = \Request::input('template') ?? $this->crud->getCurrentEntry()->template; 65 | 66 | $this->addDefaultPageFields($template); 67 | $this->useTemplate($template); 68 | 69 | $this->crud->setValidation(PageRequest::class); 70 | } 71 | 72 | // ----------------------------------------------- 73 | // Methods that are particular to the PageManager. 74 | // ----------------------------------------------- 75 | 76 | /** 77 | * Populate the create/update forms with basic fields, that all pages need. 78 | * 79 | * @param string $template The name of the template that should be used in the current form. 80 | */ 81 | public function addDefaultPageFields($template = false) 82 | { 83 | $this->crud->addField([ 84 | 'name' => 'template', 85 | 'label' => trans('backpack::pagemanager.template'), 86 | 'type' => 'select_page_template', 87 | 'view_namespace' => file_exists(resource_path('views/vendor/backpack/crud/fields/select_page_template.blade.php')) ? null : 'pagemanager::fields', 88 | 'options' => $this->getTemplatesArray(), 89 | 'value' => $template, 90 | 'allows_null' => false, 91 | 'wrapperAttributes' => [ 92 | 'class' => 'form-group col-md-6', 93 | ], 94 | ]); 95 | $this->crud->addField([ 96 | 'name' => 'name', 97 | 'label' => trans('backpack::pagemanager.page_name'), 98 | 'type' => 'text', 99 | 'wrapperAttributes' => [ 100 | 'class' => 'form-group col-md-6', 101 | ], 102 | // 'disabled' => 'disabled' 103 | ]); 104 | $this->crud->addField([ 105 | 'name' => 'title', 106 | 'label' => trans('backpack::pagemanager.page_title'), 107 | 'type' => 'text', 108 | // 'disabled' => 'disabled' 109 | ]); 110 | $this->crud->addField([ 111 | 'name' => 'slug', 112 | 'label' => trans('backpack::pagemanager.page_slug'), 113 | 'type' => 'text', 114 | 'hint' => trans('backpack::pagemanager.page_slug_hint'), 115 | // 'disabled' => 'disabled' 116 | ]); 117 | } 118 | 119 | /** 120 | * Add the fields defined for a specific template. 121 | * 122 | * @param string $template_name The name of the template that should be used in the current form. 123 | */ 124 | public function useTemplate($template_name = false) 125 | { 126 | $templates = $this->getTemplates(); 127 | 128 | // set the default template 129 | if ($template_name == false) { 130 | $template_name = $templates[0]->name; 131 | } 132 | 133 | // actually use the template 134 | if ($template_name) { 135 | $this->{$template_name}(); 136 | } 137 | } 138 | 139 | /** 140 | * Get all defined templates. 141 | */ 142 | public function getTemplates($template_name = false) 143 | { 144 | $templates_array = []; 145 | 146 | $templates_trait = new \ReflectionClass('App\PageTemplates'); 147 | $templates = $templates_trait->getMethods(\ReflectionMethod::IS_PRIVATE); 148 | 149 | if (! count($templates)) { 150 | abort(503, trans('backpack::pagemanager.template_not_found')); 151 | } 152 | 153 | return $templates; 154 | } 155 | 156 | /** 157 | * Get all defined template as an array. 158 | * 159 | * Used to populate the template dropdown in the create/update forms. 160 | */ 161 | public function getTemplatesArray() 162 | { 163 | $templates = $this->getTemplates(); 164 | 165 | foreach ($templates as $template) { 166 | $templates_array[$template->name] = str_replace('_', ' ', Str::title($template->name)); 167 | } 168 | 169 | return $templates_array; 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /src/app/Http/Requests/PageRequest.php: -------------------------------------------------------------------------------- 1 | check(); 16 | } 17 | 18 | /** 19 | * Get the validation rules that apply to the request. 20 | * 21 | * @return array 22 | */ 23 | public function rules() 24 | { 25 | $id = \Request::get('id'); 26 | 27 | return [ 28 | 'name' => 'required|min:2|max:255', 29 | 'title' => 'required|min:2|max:255', 30 | 'slug' => 'unique:pages,slug'.($id ? ','.$id : ''), 31 | ]; 32 | } 33 | 34 | /** 35 | * Get the validation attributes that apply to the request. 36 | * 37 | * @return array 38 | */ 39 | public function attributes() 40 | { 41 | return [ 42 | // 43 | ]; 44 | } 45 | 46 | /** 47 | * Get the validation messages that apply to the request. 48 | * 49 | * @return array 50 | */ 51 | public function messages() 52 | { 53 | return [ 54 | // 55 | ]; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/app/Models/Page.php: -------------------------------------------------------------------------------- 1 | 'array', 33 | ]; 34 | 35 | /** 36 | * Return the sluggable configuration array for this model. 37 | * 38 | * @return array 39 | */ 40 | public function sluggable(): array 41 | { 42 | return [ 43 | 'slug' => [ 44 | 'source' => 'slug_or_title', 45 | ], 46 | ]; 47 | } 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | FUNCTIONS 52 | |-------------------------------------------------------------------------- 53 | */ 54 | 55 | public function getTemplateName() 56 | { 57 | return str_replace('_', ' ', Str::title($this->template)); 58 | } 59 | 60 | public function getPageLink() 61 | { 62 | return url($this->slug); 63 | } 64 | 65 | public function getOpenButton() 66 | { 67 | return ''. 68 | ' '.trans('backpack::pagemanager.open').''; 69 | } 70 | 71 | /* 72 | |-------------------------------------------------------------------------- 73 | | RELATIONS 74 | |-------------------------------------------------------------------------- 75 | */ 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | SCOPES 80 | |-------------------------------------------------------------------------- 81 | */ 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | ACCESORS 86 | |-------------------------------------------------------------------------- 87 | */ 88 | 89 | // The slug is created automatically from the "name" field if no slug exists. 90 | public function getSlugOrTitleAttribute() 91 | { 92 | if ($this->slug != '') { 93 | return $this->slug; 94 | } 95 | 96 | return $this->title; 97 | } 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | MUTATORS 102 | |-------------------------------------------------------------------------- 103 | */ 104 | } 105 | -------------------------------------------------------------------------------- /src/app/PageTemplates.php: -------------------------------------------------------------------------------- 1 | crud->addField([ // CustomHTML 26 | 'name' => 'metas_separator', 27 | 'type' => 'custom_html', 28 | 'value' => '

'.trans('backpack::pagemanager.metas').'


', 29 | ]); 30 | $this->crud->addField([ 31 | 'name' => 'meta_title', 32 | 'label' => trans('backpack::pagemanager.meta_title'), 33 | 'fake' => true, 34 | 'store_in' => 'extras', 35 | ]); 36 | $this->crud->addField([ 37 | 'name' => 'meta_description', 38 | 'label' => trans('backpack::pagemanager.meta_description'), 39 | 'fake' => true, 40 | 'store_in' => 'extras', 41 | ]); 42 | $this->crud->addField([ 43 | 'name' => 'meta_keywords', 44 | 'type' => 'textarea', 45 | 'label' => trans('backpack::pagemanager.meta_keywords'), 46 | 'fake' => true, 47 | 'store_in' => 'extras', 48 | ]); 49 | $this->crud->addField([ // CustomHTML 50 | 'name' => 'content_separator', 51 | 'type' => 'custom_html', 52 | 'value' => '

'.trans('backpack::pagemanager.content').'


', 53 | ]); 54 | $this->crud->addField([ 55 | 'name' => 'content', 56 | 'label' => trans('backpack::pagemanager.content'), 57 | 'type' => 'summernote', 58 | 'placeholder' => trans('backpack::pagemanager.content_placeholder'), 59 | ]); 60 | } 61 | 62 | private function about_us() 63 | { 64 | $this->crud->addField([ 65 | 'name' => 'content', 66 | 'label' => trans('backpack::pagemanager.content'), 67 | 'type' => 'summernote', 68 | 'placeholder' => trans('backpack::pagemanager.content_placeholder'), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/config/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Backpack\PageManager\app\Http\Controllers\Admin\PageCrudController', 6 | 7 | // Change this class if you wish to extend the Page model 8 | 'page_model_class' => 'Backpack\PageManager\app\Models\Page', 9 | ]; 10 | -------------------------------------------------------------------------------- /src/database/migrations/2016_05_25_121918_create_pages_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('template'); 19 | $table->string('name'); 20 | $table->string('title'); 21 | $table->string('slug'); 22 | $table->text('content')->nullable(); 23 | $table->text('extras')->nullable(); 24 | $table->timestamps(); 25 | $table->softDeletes(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::drop('pages'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/database/migrations/2017_04_10_195926_change_extras_to_longtext.php: -------------------------------------------------------------------------------- 1 | longText('extras')->nullable()->change(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('pages', function (Blueprint $table) { 29 | $table->text('extras')->nullable()->change(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/resources/lang/ar/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'هل أنت متأكد من تغيير قالب الصفحة؟ ستخسر أي تغيير لم تقم بحفظه لهذه الصفحة', 5 | 'content' => 'المحتوى', 6 | 'content_placeholder' => 'محتواك هنا', 7 | 'meta_description' => 'وصف الميتا', 8 | 'meta_keywords' => 'الكلمات المفتاحية للميتا', 9 | 'meta_title' => 'عنوان الميتا', 10 | 'metas' => 'الميتا', 11 | 'name' => 'الإسم', 12 | 'open' => 'إفتح', 13 | 'page' => 'الصفحة', 14 | 'page_name' => 'إسم الصفحة (مرئي من قبل المشرفين فقط)', 15 | 'page_slug' => 'رابط الصفحة (Slug)', 16 | 'page_slug_hint' => 'في حال لم يتم ملء هذا الحقل، سيتم إنشاءه بشكل تلقائي من عنوان الصفحة ', 17 | 'page_title' => 'عنوان الصفحة', 18 | 'pages' => 'الصفحات', 19 | 'slug' => 'Slug', 20 | 'template' => 'القوالب', 21 | 'template_not_found' => 'هذا القالب غير موجود. من الممكن انه تم حذفه بما أن الصفحة قد انشأت. للمتابعة، الرجاء التواصل مع مدير الموقع او فريق التطوير.', 22 | 23 | ]; 24 | -------------------------------------------------------------------------------- /src/resources/lang/da_DK/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Er du sikker på at du vil ændre side skabelonen? Du mister ugemte ændringer for denne side.', 5 | 'content' => 'Indhold', 6 | 'content_placeholder' => 'dit Indhold indsættes her', 7 | 'meta_description' => 'Meta beskrivelse', 8 | 'meta_keywords' => 'Meta søgeord', 9 | 'meta_title' => 'Meta titel', 10 | 'metas' => 'Metaer', 11 | 'name' => 'Navn', 12 | 'open' => 'åben', 13 | 'page' => 'side', 14 | 'page_name' => 'Side navn (kan kun ses af administratorer)', 15 | 'page_slug' => 'Page Slug (Link)', 16 | 'page_slug_hint' => 'Vil automatisk blive genereret fra titlen, hvis denne efterlades blank.', 17 | 'page_title' => 'Side Titel', 18 | 'pages' => 'Sider', 19 | 'slug' => 'Slug', 20 | 'template' => 'Skabelon', 21 | 'template_not_found' => 'Skabelonen kunne ikke findes. Den kan være blevet slettet siden denne side blev oprettet. For at forsætte så bed din web administrator, eller udviklingsteam om at løse dette.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/de/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Willst Du die Vorlage wirklich ändern? Alle ungespeicherten Änderungen gehen dardurch verloren.', 5 | 'content' => 'Inhalt', 6 | 'content_placeholder' => 'Inhalt eingeben', 7 | 'meta_description' => 'Meta Beschreibung', 8 | 'meta_keywords' => 'Meta Schlüsselwörter', 9 | 'meta_title' => 'Meta Titel', 10 | 'metas' => 'Metas', 11 | 'name' => 'Name', 12 | 'open' => 'Öffnen', 13 | 'page' => 'Seite', 14 | 'page_name' => 'Seitenname (nur für Admins sichtbar)', 15 | 'page_slug' => 'Seiten-Slug (URL)', 16 | 'page_slug_hint' => 'Wird automatisch generiert, falls leer.', 17 | 'page_title' => 'Seitentitel', 18 | 'pages' => 'Seiten', 19 | 'slug' => 'Slug', 20 | 'template' => 'Vorlage', 21 | 'template_not_found' => 'Die Vorlage wurde nicht gefunden. Möglicheweise wurde sie nach Erstellen der Seite gelöscht. Bitte frage Deine Entwickler um Hilfe.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/en/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Are you sure you want to change the page template? You will lose any unsaved modifications for this page.', 5 | 'content' => 'Content', 6 | 'content_placeholder' => 'Your content here', 7 | 'meta_description' => 'Meta Description', 8 | 'meta_keywords' => 'Meta Keywords', 9 | 'meta_title' => 'Meta Title', 10 | 'metas' => 'Metas', 11 | 'name' => 'Name', 12 | 'open' => 'Open', 13 | 'page' => 'page', 14 | 'page_name' => 'Page name (only seen by admins)', 15 | 'page_slug' => 'Page Slug (URL)', 16 | 'page_slug_hint' => 'Will be automatically generated from your title, if left empty.', 17 | 'page_title' => 'Page Title', 18 | 'pages' => 'pages', 19 | 'slug' => 'Slug', 20 | 'template' => 'Template', 21 | 'template_not_found' => 'The template could not be found. It might have been deleted since this page was created. To continue, please ask your webmin or development team to fix this.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/es/pagemanager.php: -------------------------------------------------------------------------------- 1 | '¿Estás seguro de actualizar la plantilla de la página? Perderás los cambios que no hayan sido guardados para esta página.', 5 | 'content' => 'Contenido', 6 | 'content_placeholder' => 'Tu contenido aquí', 7 | 'meta_description' => 'Meta Descripción', 8 | 'meta_keywords' => 'Palabras Clave', 9 | 'meta_title' => 'Meta Título', 10 | 'metas' => 'Optimización de Búsquedas (SEO)', 11 | 'name' => 'Nombre', 12 | 'open' => 'Abierto', 13 | 'page' => 'página', 14 | 'page_name' => 'Nombre de la página (visible solo para administradores)', 15 | 'page_slug' => '"Slug" de la página (URL)', 16 | 'page_slug_hint' => 'Será generado automáticamente desde el título, si se deja vacío.', 17 | 'page_title' => 'Título de Página', 18 | 'pages' => 'páginas', 19 | 'slug' => 'Slug', 20 | 'template' => 'Plantilla', 21 | 'template_not_found' => 'La plantilla no pudo ser encontrada. Pudo haber sido eliminada desde que se creó esta página. Para continuar, por favor contacta al administrador o desarrollador para solucionarlo.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/fa/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'آیا مطمئن هستید که می خواهید الگوی صفحه را تغییر دهید؟ شما اصلاحات ذخیره نشده برای این صفحه را از دست خواهید داد.', 5 | 'content' => 'محتوا', 6 | 'content_placeholder' => 'محتوای شما اینجاست', 7 | 'meta_description' => 'فرا توضیحات', 8 | 'meta_keywords' => 'فرا کلمات کلیدی', 9 | 'meta_title' => 'فرا عنوان', 10 | 'metas' => 'فراها', 11 | 'name' => 'نام', 12 | 'open' => 'باز', 13 | 'page' => 'صفحه', 14 | 'page_name' => 'عنوان صفحه (فقط برای مدیران دیده می‌شود)', 15 | 'page_slug' => 'Page Slug (URL)', 16 | 'page_slug_hint' => 'در صورت خالی ماندن ، به طور خودکار از عنوان شما تولید می شود.', 17 | 'page_title' => 'عنوان صفحه', 18 | 'pages' => 'صفحات', 19 | 'slug' => 'Slug', 20 | 'template' => 'الگو', 21 | 'template_not_found' => 'الگو یافت نشد. ممکن است در حین ایجاد این صفحه حذف شده باشد. برای ادامه ، لطفاً از مدیر وب سایت یا تیم توسعه خود بخواهید که این مشکل را برطرف کند.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/fr/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Confirmez-vous le changement de modèle? Toutes les modifications non enregistrées pour cette page seront perdues.', 5 | 'content' => 'Contenu', 6 | 'content_placeholder' => 'Saisissez le contenu de la page ici', 7 | 'meta_description' => 'Méta description', 8 | 'meta_keywords' => 'Méta mots-clés', 9 | 'meta_title' => 'Méta titre', 10 | 'metas' => 'Balises META', 11 | 'name' => 'Nom', 12 | 'open' => 'Ouvrir', 13 | 'page' => 'page', 14 | 'page_name' => 'Nom de page (visible uniquement par les admins)', 15 | 'page_slug' => 'Url simplifiée', 16 | 'page_slug_hint' => 'Sera générée automatiquement à partir du titre si laissée vide.', 17 | 'page_title' => 'Titre de la page', 18 | 'pages' => 'pages', 19 | 'slug' => 'Url simplifiée', 20 | 'template' => 'Modèle', 21 | 'template_not_found' => 'Le modèle de page n’a pu être trouvé. Il a dû être supprimé ou renommé depuis la création de cette page. Pour poursuivre, veuillez demander l’intervention de votre webmaster ou développeur.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/id/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Anda yakin ingin mengubah templat halaman? Anda akan kehilangan modifikasi yang belum disimpan untuk halaman ini.', 5 | 'content' => 'Konten', 6 | 'content_placeholder' => 'Konten Anda di sini', 7 | 'meta_description' => 'Deskripsi meta', 8 | 'meta_keywords' => 'Meta Keywords', 9 | 'meta_title' => 'Kata Kunci Meta', 10 | 'metas' => 'Meta', 11 | 'name' => 'Nama', 12 | 'open' => 'Buka', 13 | 'page' => 'halaman', 14 | 'page_name' => 'Nama halaman (hanya dilihat oleh admin)', 15 | 'page_slug' => 'Halaman Slug (URL)', 16 | 'page_slug_hint' => 'Akan dibuat secara otomatis dari judul Anda, jika dibiarkan kosong.', 17 | 'page_title' => 'Judul halaman', 18 | 'pages' => 'halaman', 19 | 'slug' => 'Slug', 20 | 'template' => 'Template', 21 | 'template_not_found' => 'Template tidak dapat ditemukan. Mungkin sudah dihapus sejak halaman ini dibuat. Untuk melanjutkan, minta webmin atau tim pengembangan Anda untuk memperbaikinya.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/it/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Sei sicuro di voler cambiare il template della pagina? Perderai qualsiasi modifiche non salvata per questa pagina.', 5 | 'content' => 'Contenuto', 6 | 'content_placeholder' => 'Il tuo contenuto qui', 7 | 'meta_description' => 'Meta Description', 8 | 'meta_keywords' => 'Meta Keywords', 9 | 'meta_title' => 'Meta Title', 10 | 'metas' => 'Meta', 11 | 'name' => 'Nome', 12 | 'open' => 'Apri', 13 | 'page' => 'pagina', 14 | 'page_name' => 'Nome pagina (visibile solo agli amministratori)', 15 | 'page_slug' => 'Slug pagina (URL)', 16 | 'page_slug_hint' => 'Se lasciato in bianco, verrà automaticamente generato dal titolo.', 17 | 'page_title' => 'Titolo pagina', 18 | 'pages' => 'pagine', 19 | 'slug' => 'Slug', 20 | 'template' => 'Template', 21 | 'template_not_found' => 'Il template non è stato trovato. Potrebbe essere stato eliminato da quando la pagina è stata creata. Per continuare, chiedi al tuo amministratore o al team di sviluppo di risolvere questo problema.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/nl/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Weet je zeker dat je de pagina template wilt aanpassen? Als er nog niet op opslaan is geklikt wordt alle op deze pagina ingevoerde data verwijderd.', 5 | 'content' => 'Content', 6 | 'content_placeholder' => 'Je content hier', 7 | 'meta_description' => 'Meta Description', 8 | 'meta_keywords' => 'Meta Keywords', 9 | 'meta_title' => 'Meta Title', 10 | 'metas' => 'Meta informatie', 11 | 'name' => 'Naam', 12 | 'open' => 'Open', 13 | 'page' => 'pagina', 14 | 'page_name' => 'Pagina naam (alleen zichtbaar in admin)', 15 | 'page_slug' => 'Vriendelijke URL naam', 16 | 'page_slug_hint' => 'Deze wordt bij leeg laten automatisch gegeneeerd.', 17 | 'page_title' => 'Pagina titel', 18 | 'pages' => 'pagina\'s', 19 | 'slug' => 'Slug', 20 | 'template' => 'Template', 21 | 'template_not_found' => 'De template is niet gevonden. Misschien is deze verwijderd nadat deze pagina is aangemaakt. Neem contact op met de web ontwikkelaar', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/pt/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Tem a certeza que quer mudar o modelo da página? Vai perder as alterações que não tenham sido guardadas.', 5 | 'content' => 'Conteúdo', 6 | 'content_placeholder' => 'O seu conteúdo aqui', 7 | 'meta_description' => 'Descrição (meta)', 8 | 'meta_keywords' => 'Palavras-chave (meta)', 9 | 'meta_title' => 'Título (meta)', 10 | 'metas' => 'Metas', 11 | 'name' => 'Nome', 12 | 'open' => 'Abrir', 13 | 'page' => 'página', 14 | 'page_name' => 'Nome da página (visível apenas a administradores)', 15 | 'page_slug' => 'Slug da página (URL)', 16 | 'page_slug_hint' => 'Se não for preenchido, será gerado automaticamente a partir do título.', 17 | 'page_title' => 'Título da página', 18 | 'pages' => 'páginas', 19 | 'slug' => 'Slug', 20 | 'template' => 'Modelo', 21 | 'template_not_found' => 'O modelo não foi encontrado. Pode ter sido apagado depois desta página ter sido criada. Para continuar, por favor peça ao seu administrador ou equipa de desenvolvimento para corrigir este problema.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/ru/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Внимание! Если вы только что вносили изменения в любые поля и не сохранили их, они будут утеряны при изменении шаблона. Продолжить?', 5 | 'content' => 'Содержание', 6 | 'content_placeholder' => 'Введите содержание здесь', 7 | 'meta_description' => 'Описание (Description)', 8 | 'meta_keywords' => 'Ключевые слова (Keywords)', 9 | 'meta_title' => 'Название страницы (Title)', 10 | 'metas' => 'Meta', 11 | 'name' => 'Название', 12 | 'open' => 'Перейти', 13 | 'page' => 'страница', 14 | 'page_name' => 'Название страницы (для администраторов)', 15 | 'page_slug' => 'ЧПУ (slug)', 16 | 'page_slug_hint' => 'Будет автоматически сгенерирован из вашего заголовка, если оставить его пустым', 17 | 'page_title' => 'Название страницы', 18 | 'pages' => 'страницы', 19 | 'slug' => 'ЧПУ (slug)', 20 | 'template' => 'Шаблон', 21 | 'template_not_found' => 'Не удалось найти шаблон. Возможно, он был удален после того, как страница была создана. Чтобы продолжить, попросите вашего веб-администратора или команду разработчиков исправить это', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/tr/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Sayfa şablonunu değiştirmek istediğinizden eminmisiniz? Bu sayfa için uyguladığınız tüm değişiklikleri kaybedeceksiniz.', 5 | 'content' => 'İçerik', 6 | 'content_placeholder' => 'İçeriğinizi buraya girebilirsiniz....', 7 | 'meta_description' => 'Meta Açıklama', 8 | 'meta_keywords' => 'Meta Anahtar Kelimeler', 9 | 'meta_title' => 'Meta Başlığı', 10 | 'metas' => 'SEO', 11 | 'name' => 'Adı', 12 | 'open' => 'Açık', 13 | 'page' => 'sayfa', 14 | 'page_name' => 'Sayfa adı (Yalnızca yöneticiler tarafından görünür.)', 15 | 'page_slug' => 'Sayfa URL', 16 | 'page_slug_hint' => 'Boş bırakıldığında sayfa adından otomatik olarak oluşturulacaktır.', 17 | 'page_title' => 'Sayfa Başlığı', 18 | 'pages' => 'sayfalar', 19 | 'slug' => 'Slug', 20 | 'template' => 'Şablon', 21 | 'template_not_found' => 'Şablon bulunamadı. Bu sayfa oluşturulmadan önce silinmiş olabilir. Lütfen geliştirici ekibinizden bunu düzeltmesini isteyin.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/uk/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Ви впевнені, що хочете змінити шаблон сторінки? Ви втратите будь-які незбережені зміни для цієї сторінки.', 5 | 'content' => 'Зміст', 6 | 'content_placeholder' => 'Ваш вміст тут', 7 | 'meta_description' => 'Опис (Meta Description)', 8 | 'meta_keywords' => 'Ключові слова (Meta Keywords)', 9 | 'meta_title' => 'Заголовок (Meta Title)', 10 | 'metas' => 'Мета-теги', 11 | 'name' => 'Назва', 12 | 'open' => 'Відкрити', 13 | 'page' => 'сторінка', 14 | 'page_name' => 'Назва сторінки (бачать лише адміністратори)', 15 | 'page_slug' => 'Slug сторінки (URL)', 16 | 'page_slug_hint' => 'Буде автоматично створено з вашого заголовка, якщо залишити його порожнім.', 17 | 'page_title' => 'Заголовок сторінки', 18 | 'pages' => 'сторінки', 19 | 'slug' => 'Slug сторінки', 20 | 'template' => 'Шаблон', 21 | 'template_not_found' => 'Не вдалося знайти шаблон. Можливо, його було видалено з моменту створення цієї сторінки. Щоб продовжити, попросіть свого веб-адміністратора або команду розробників це виправити.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/lang/vi/pagemanager.php: -------------------------------------------------------------------------------- 1 | 'Bạn có chắc muốn thay đổi mẫu trang? Mọi thay đổi sẽ không được lưu cho trang này.', 5 | 'content' => 'Nội dung', 6 | 'content_placeholder' => 'Nhập nội dung của bạn', 7 | 'meta_description' => 'Meta Description', 8 | 'meta_keywords' => 'Meta Keywords', 9 | 'meta_title' => 'Meta Title', 10 | 'metas' => 'Metas', 11 | 'name' => 'Tên', 12 | 'open' => 'Mở ra', 13 | 'page' => 'page', 14 | 'page_name' => 'Tiêu đề trang (chỉ hiển thị với admins)', 15 | 'page_slug' => 'Đường dẫn trang (URL)', 16 | 'page_slug_hint' => 'Đường dẫn sẽ tự động được tạo từ tiêu đề của bạn, nếu bạn để trống nó.', 17 | 'page_title' => 'Tiêu đề trang', 18 | 'pages' => 'pages', 19 | 'slug' => 'Đường dẫn', 20 | 'template' => 'Mẫu', 21 | 'template_not_found' => 'Không thể tìm thấy mẫu này. Nó có thể đã bị xóa kể từ khi trang này được tạo ra. Để tiếp tục, vui lòng yêu cầu webmin hoặc nhóm phát triển của bạn khắc phục lỗi này.', 22 | ]; 23 | -------------------------------------------------------------------------------- /src/resources/views/vendor/backpack/crud/fields/select_page_template.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @include('crud::fields.inc.wrapper_start') 3 | 4 | 5 | 30 | 31 | @if (isset($field['hint'])) 32 |

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

33 | @endif 34 | @include('crud::fields.inc.wrapper_end') 35 | 36 | 37 | {{-- ########################################## --}} 38 | {{-- Extra CSS and JS for this particular field --}} 39 | {{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} 40 | @if ($crud->checkIfFieldIsFirstOfItsType($field, $fields)) 41 | 42 | {{-- FIELD JS - will be loaded in the after_scripts section --}} 43 | @push('crud_fields_scripts') 44 | 45 | 87 | @endpush 88 | @endif 89 | {{-- End of Extra CSS and JS --}} 90 | {{-- ########################################## --}} 91 | -------------------------------------------------------------------------------- /src/routes/backpack/pagemanager.php: -------------------------------------------------------------------------------- 1 | '', 15 | 'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], 16 | 'prefix' => config('backpack.base.route_prefix', 'admin'), 17 | ], function () { 18 | $controller = config('backpack.pagemanager.admin_controller_class', 'Backpack\PageManager\app\Http\Controllers\Admin\PageCrudController'); 19 | Route::crud('page', $controller); 20 | }); 21 | -------------------------------------------------------------------------------- /tests/BaseTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | --------------------------------------------------------------------------------