Download the PHP package archtechx/laravel-pages without Composer

On this page you can find all versions of the php package archtechx/laravel-pages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-pages

Laravel Pages

This package lets you create pages using Markdown or Blade without having to worry about creating routes or controllers yourself.

Essentially, you create either content/pages/foo.md or resources/views/pages/foo.blade.php and the page will be accessible on the /foo route.

Markdown 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.

For instance, you could have the /pricing route use a Blade file (pages/pricing.blade.php) with a pretty design that accompanies your pricing copy.

Whereas 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.

We use this on the ArchTech website — the About, Careers, and Open Source pages are simple Markdown files.

Installation

Require the package via composer:

Publish the config file:

And finally, add this line to the end of your routes/web.php file:

This 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.

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.

Usage

Markdown pages

To create a markdown file, create a file in content/pages/. The route to the page will match the file name (without .md).

For example, to create the /about page, create content/pages/about.md with this content:

Blade pages

To 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.

Therefore to create the /about page, you'd create resources/views/pages/about.blade.php:

Configuration

You'll likely want to configure a few things, most likely the used layout.

To do that, simply modify config/pages.php.

The config file lets you change:

The 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.

If 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.

And 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()):

Ecosystem support

The package perfectly supports other tools in the ecosystem, such as Laravel Nova or Lean Admin.

For example, in Laravel Nova you could create a resource for the package-provided Page model (ArchTech\Pages\Page) and use the following field schema:

Git integration & Orbit

This package uses 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.

The package also uses another package of ours, 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 <head> section:

Password-protected routes

The 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:

Now 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.


All versions of laravel-pages with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0
archtechx/laravel-seo Version ^0.10
ryangjchandler/orbit Version ^1.3
illuminate/routing Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package archtechx/laravel-pages contains the following files

Loading the files please wait ....