{"id":20012314,"url":"https://github.com/archtechx/laravel-pages","last_synced_at":"2025-07-04T03:34:47.259Z","repository":{"id":44548636,"uuid":"386346006","full_name":"archtechx/laravel-pages","owner":"archtechx","description":"Easily add routes to your Laravel app by creating Markdown or Blade files","archived":false,"fork":false,"pushed_at":"2024-03-13T13:49:26.000Z","size":44,"stargazers_count":118,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-21T00:50:17.167Z","etag":null,"topics":["laravel","markdown","php"],"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/archtechx.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}},"created_at":"2021-07-15T15:53:12.000Z","updated_at":"2024-11-15T15:59:10.000Z","dependencies_parsed_at":"2024-03-12T13:57:59.592Z","dependency_job_id":"3b5cf6da-8cff-43a4-bdba-48955c76fec1","html_url":"https://github.com/archtechx/laravel-pages","commit_stats":{"total_commits":19,"total_committers":3,"mean_commits":6.333333333333333,"dds":0.368421052631579,"last_synced_commit":"8fa1a148dd859be8aa00102d070fe966d6bd51dc"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":"archtechx/template","purl":"pkg:github/archtechx/laravel-pages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Flaravel-pages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Flaravel-pages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Flaravel-pages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Flaravel-pages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archtechx","download_url":"https://codeload.github.com/archtechx/laravel-pages/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Flaravel-pages/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263440878,"owners_count":23467007,"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":["laravel","markdown","php"],"created_at":"2024-11-13T07:29:43.152Z","updated_at":"2025-07-04T03:34:47.201Z","avatar_url":"https://github.com/archtechx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Pages\n\nThis package lets you create pages using Markdown or Blade without having to worry about creating routes or controllers yourself.\n\nEssentially, you create either `content/pages/foo.md` or `resources/views/pages/foo.blade.php` and the page will be accessible on the `/foo` route.\n\nMarkdown files use a pre-defined Blade view to get rendered. Blade files are meant for pages which don't follow the default layout and need more custom styling.\n\nFor instance, you could have the `/pricing` route use a Blade file (`pages/pricing.blade.php`) with a pretty design that accompanies your pricing copy.\n\nWhereas for `/about`, you could have a simple Markdown file (`content/pages/about.md`) that describes your service using pure text without any special graphical elements.\n\nWe use this on the ArchTech website — the [About](https://archte.ch/about), [Careers](https://archte.ch/careers), and [Open Source](https://archte.ch/open-source) pages are simple Markdown files.\n\n## Installation\n\nRequire the package via composer:\n\n```\ncomposer require archtechx/laravel-pages\n```\n\nPublish the config file:\n\n```\nphp artisan vendor:publish --tag=archtech-pages-config\n```\n\nAnd finally, add this line to the **end** of your `routes/web.php` file:\n\n```php\nArchTech\\Pages\\Page::routes();\n```\n\nThis line will register the routes in a way that ensures that your routes take precedence, and the page route is only used as the final option.\n\n**Important: Before attempting to visit URLs managed by this package, make sure that you configure it to use the correct layout (see the section below). Otherwise you might get an error saying that the view cannot be found.**\n\n## Usage\n\n### Markdown pages\n\nTo create a markdown file, create a file in `content/pages/`. The route to the page will match the file name (without `.md`).\n\nFor example, to create the `/about` page, create `content/pages/about.md` with this content:\n\n```md\n---\nslug: about\ntitle: 'About us'\nupdated_at: 2021-05-19T19:09:02+00:00\ncreated_at: 2021-05-19T19:09:02+00:00\n---\n\nWe are a web development agency that specializes in ...\n```\n\n### Blade pages\n\nTo create a Blade page, create a file in `resources/views/pages/`. Like in the Markdown example, the route to the page will match the file name without the extension.\n\nTherefore to create the `/about` page, you'd create `resources/views/pages/about.blade.php`:\n\n```html\n\u003cx-app-layout\u003e\n    This view can use any layouts or markup.\n\u003c/x-app-layout\u003e\n```\n\n## Configuration\n\nYou'll likely want to configure a few things, most likely the used layout.\n\nTo do that, simply modify `config/pages.php`.\n\nThe config file lets you change:\n- the used model\n- the used controller\n- the layout used by the markdown views\n- the view file used to render Markdown pages\n- routing details\n\nThe layout is used *by* the vendor (package-provided) Markdown view. You'll likely want to set it to something like `app-layout` or `layouts.app`.\n\nIf you'd like to change the file that renders the Markdown itself, create `resources/views/pages/_markdown.blade.php` (the `_` prefix is important as it prevents direct visits) and change the `pages.views.markdown` config key to `pages._markdown`.\n\nAnd if you'd like to customize the routing logic more than the config file allows you, simply register the route yourself (instead of calling `Page::routes()`):\n\n```php\nRoute::get('/{page}', ArchTech\\Pages\\PageController::class);\n```\n\n## Ecosystem support\n\nThe package perfectly supports other tools in the ecosystem, such as [Laravel Nova](https://nova.laravel.com) or [Lean Admin](https://lean-admin.dev).\n\nFor example, in Laravel Nova you could create a resource for the package-provided `Page` model (`ArchTech\\Pages\\Page`) and use the following field schema:\n\n```php\npublic function fields(Request $request)\n{\n    return [\n        Text::make('slug'),\n        Text::make('title'),\n        Markdown::make('content'),\n    ];\n}\n```\n\n## Git integration \u0026 Orbit\n\nThis package uses [Orbit](https://github.com/ryangjchandler/orbit) under the hood — to manage the Markdown files as Eloquent models. If you'd like to customize some things related to that logic, take a look at the Orbit documentation.\n\nThe package also uses another package of ours, [Laravel SEO](https://github.com/archtechx/laravel-seo), to provide meta tag support for Markdown pages. We recommended that you use this package yourself, since it will make handling meta tags as easy as adding the following line to your layout's `\u003chead\u003e` section:\n\n```html\n\u003cx-seo::meta /\u003e\n```\n\n## Password-protected routes\n\nThe package also lets you protect certain routes with passwords. To add a password to a page, simply specify the `password` key in the YAML front matter:\n\n```yaml\npassword: 'foo'\n```\n\nNow if a user wants to visit the page, he will **have to** include `?password=foo` in the URL, otherwise he'll be presented with a 403 error.\n\n```diff\n- /about\n+ /about?password=foo\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchtechx%2Flaravel-pages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchtechx%2Flaravel-pages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchtechx%2Flaravel-pages/lists"}