{"id":14976021,"url":"https://github.com/aimeos/laravel-cms","last_synced_at":"2025-05-07T13:04:45.995Z","repository":{"id":69054599,"uuid":"603783709","full_name":"aimeos/laravel-cms","owner":"aimeos","description":"Easy, flexible and powerful API-first Laravel CMS package with JSON:API and GraphQL APIs","archived":false,"fork":false,"pushed_at":"2025-05-05T10:05:30.000Z","size":4821,"stargazers_count":38,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T13:04:36.604Z","etag":null,"topics":["api","api-graphql","cms","content","content-management","content-management-system","contentful","graphql","graphql-api","headless-cms","jsonapi","laravel","laravel-cms","multi-tenancy","multi-tenant","multitenancy","multitenant","php","vuejs","vuejs3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimeos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-19T15:10:15.000Z","updated_at":"2025-05-05T10:05:33.000Z","dependencies_parsed_at":"2025-01-10T12:42:33.908Z","dependency_job_id":"03b35af7-a275-40f1-9361-a5dd673882fe","html_url":"https://github.com/aimeos/laravel-cms","commit_stats":{"total_commits":305,"total_committers":2,"mean_commits":152.5,"dds":0.04590163934426228,"last_synced_commit":"2198ac62e1bd5029d48b47e11cd18405efaa50a1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimeos%2Flaravel-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimeos%2Flaravel-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimeos%2Flaravel-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimeos%2Flaravel-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimeos","download_url":"https://codeload.github.com/aimeos/laravel-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883226,"owners_count":21819158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-graphql","cms","content","content-management","content-management-system","contentful","graphql","graphql-api","headless-cms","jsonapi","laravel","laravel-cms","multi-tenancy","multi-tenant","multitenancy","multitenant","php","vuejs","vuejs3"],"created_at":"2024-09-24T13:53:09.058Z","updated_at":"2025-05-07T13:04:45.982Z","avatar_url":"https://github.com/aimeos.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Laravell CMS](assets/laravel-cms.svg)\n\n# Laravel CMS - Powerful as Contentful, simple as Wordpress!\n\nThe easy, flexible and scalable API-first Laravel CMS package:\n\n* Manage structured content like in Contentful\n* Define new content elements in seconds\n* Assign shared content to multiple pages\n* Save, publish and revert drafts\n* Extremly fast JSON frontend API\n* Versatile GraphQL admin API\n* Multi-language support\n* Multi-domain routing\n* Multi-tenancy capable\n* Supports soft-deletes\n* Fully Open Source\n* Scales from single page with SQLite to millions of pages with DB clusters\n\nIt can be installed into any existing Laravel application.\n\n## Table of contents\n\n* [Installation](#installation)\n* [Authorization](#authorization)\n* [Clean up](#clean-up)\n* [Multi-domain](#multi-domain)\n* [Multi-tenancy](#multi-tenancy)\n* [Custom authorization](#custom-authorization)\n\n## Installation\n\nRun this command within your Laravel application directory:\n\n```bash\ncomposer req aimeos/laravel-cms\nphp artisan cms:install --seed\n```\n\nIf you don't want to add any demo pages, remove the `--seed` option.\n\nAdd a line in the \"post-update-cmd\" section of your `composer.json` file to update the admin backend files after each update:\n\n```json\n\"post-update-cmd\": [\n    \"@php artisan vendor:publish --force --tag=admin\",\n    ...\n],\n\n```\n\n### Authorization\n\nTo allow existing users to edit CMS content or to create a new users if they don't exist yet, you can use the `cms:user` command (replace the e-mail address by the users one):\n\n```bash\nphp artisan cms:user editor@example.com\n```\n\nTo disallow users to edit CMS content, use:\n\n```bash\nphp artisan cms:user --disable editor@example.com\n```\n\nThe CMS admin backend is available at (replace \"mydomain.tld\" with your own one):\n\n```\nhttp://mydomain.tld/cmsadmin\n```\n\n### Publishing\n\nFor scheduled publishing, you need to add this line to the `routes/console.php` class:\n\n```php\n\\Illuminate\\Support\\Facades\\Schedule::command('cms:publish')-\u003edaily();\n```\n\n### Clean up\n\nTo clean up soft-deleted pages, elements and files regularly, add these lines to the `routes/console.php` class:\n\n```php\n\\Illuminate\\Support\\Facades\\Schedule::command('model:prune', [\n    '--model' =\u003e [\n        \\Aimeos\\Cms\\Models\\Page::class,\n        \\Aimeos\\Cms\\Models\\Element::class,\n        \\Aimeos\\Cms\\Models\\File::class\n    ],\n])-\u003edaily();\n```\n\nYou can configure the timeframe after soft-deleted items will be removed permantently by setting the [cms.purge](https://github.com/aimeos/laravel-cms/blob/master/config/cms.php) option. It's value must be the number of days after the items will be removed permanently or FALSE if the soft-deleted items shouldn't be removed at all.\n\n### Multi-domain\n\nUsing multiple page trees with different domains is possible by changing the `cms.page` route in your `./routes/web.php` to:\n\n```php\nRoute::group(['domain' =\u003e '{domain}'], function() {\n    Route::get('{slug?}/{lang?}', [\\Aimeos\\Cms\\Http\\Controllers\\PageController::class, 'index'])-\u003ename('cms.page');\n});\n```\n\nThe `domain` property in the pages must then match the request domain.\n\n### Multi-tenancy\n\nLaravel CMS supports single database multi-tenancy using existing Laravel tenancy packages or code implemented by your own.\n\nThe [Tenancy for Laravel](https://tenancyforlaravel.com/) package is most often used. How to set up the package is described in the [tenancy quickstart](https://tenancyforlaravel.com/docs/v3/quickstart) and take a look into the [single database tenancy](https://tenancyforlaravel.com/docs/v3/single-database-tenancy) article too.\n\nAfterwards, tell Laravel CMS how the ID of the current tenant can be retrieved. Add this code to the `boot()` method of your `\\App\\Providers\\AppServiceProvider` in the `./app/Providers/AppServiceProvider.php` file:\n\n```php\n\\Aimeos\\Cms\\Tenancy::$callback = function() {\n    return tenancy()-\u003einitialized ? tenant()-\u003egetTenantKey() : '';\n};\n```\n\n### Custom authorization\n\nIf you want to integrate Laravel CMS into another application, you may want to grant access based ony your own authorization scheme. You can replace the Laravel CMS permission handling by adding your own function. Add this code to the `boot()` method of your `\\App\\Providers\\AppServiceProvider` in the `./app/Providers/AppServiceProvider.php` file:\n\n```php\n\\Aimeos\\Cms\\Permission::$callback = function( string $action, ?\\App\\Models\\User $user ) : bool {\n    if( /* check access */ ) {\n        return true;\n    }\n\n    return false;\n};\n```\n\nThe first parameter is the action access is requested for, e.g. \"page:view\" while the second parameter is the user object if authenticated. By default, permissions of CMS users are checked against the authorization bitmap from the `cmseditor` column of their user object from the Laravel `users` table. The function must return TRUE to grant access or FALSE if access is denied.\n\nAvailable actions which access can be granted to are:\n\n* page:view (show page tree)\n* page:save (update existing pages)\n* page:add (add new pages)\n* page:drop (soft-delete pages)\n* page:keep (restore soft-deleted pages)\n* page:purge (delete pages permanently)\n* page:publish (publish page meta data)\n* page:move (move pages in the tree)\n* element:view (show element elements)\n* element:save (update existing element elements)\n* element:add (add new element elements)\n* element:drop (soft-delete element elements)\n* element:keep (restore soft-deleted element elements)\n* element:purge (delete element elements permanently)\n* element:publish (publish element elements)\n* element:move (move element elements within a page)\n* file:view (show uploaded files)\n* file:save (update existing files)\n* file:add (add new files)\n* file:drop (soft-delete files)\n* file:keep (restore soft-deleted files)\n* file:purge (delete files permanently)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimeos%2Flaravel-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimeos%2Flaravel-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimeos%2Flaravel-cms/lists"}