Download the PHP package snellingio/folio-markdown without Composer

On this page you can find all versions of the php package snellingio/folio-markdown. 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 folio-markdown

Markdown for Laravel Folio

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Folio Markdown is an extension for the Laravel Folio page-based router that enables the creation of routes using .md and .blade.md files. This simplifies the process of generating routes in Laravel applications.

Overview

Laravel Folio allows you to generate routes by creating Blade templates in your application's resources/views/pages directory. Folio Markdown enhances this functionality by enabling you to create routes using Markdown files in the same directory.

For example, to create a page accessible at the /greeting URL, you can create a greeting.md file in the resources/views/pages directory:

The YAML front matter is converted into variables for the view template, and the Markdown content is passed to the view template as a $slot variable.

Installation Steps

Follow these steps to install and setup Folio Markdown:

  1. Install Laravel Folio: Use Composer to install Laravel Folio into your Laravel application:

  2. Execute folio:install: Run the folio:install Artisan command. This installs Folio's service provider and registers the directory where Folio will look for routes or pages:

  3. Install the Folio Markdown package: Install the Folio Markdown package using Composer:

  4. Register Folio Markdown: In your App\Providers\FolioServiceProvider file, call the register method using the FolioMarkdown Facade:

With these steps completed, you can now create routes using Markdown files in your Laravel application.

Quick Highlights

Folio Markdown supports a variety of features, including:

Please refer to the detailed guide below for a comprehensive understanding of each feature.

Understanding File Extensions

Files that end with .md are automatically recognized and processed as Markdown files. If a file ends with .blade.md, it will first be processed as a Blade template, then as a Markdown file. This allows you to use specific Blade directives within your Markdown files. However, keep in mind that some Blade directives, like @push and @section, that are used across components might not work because each file is processed individually.

Markdown Extensions

Under the hood, Folio Markdown uses the Spatie Laravel Markdown package.

While Folio Markdown respects the config of the Spatie Laravel Markdown package, currently code highlighting via Shiki is disabled (@TODO: need to create an issue!).

How to Use View Templates

To use a view template, you need to include the view key in the front matter of the page, like this:

The content of the page will then be passed to the view template as the $slot variable.

Working with Soft Deleted Models

By default, soft deleted models are not included when resolving implicit model bindings. If you want Folio Markdown to also include these models, add the withTrashed key to the page's front matter:

Applying Middleware

If you want to use middleware for a specific page, include the middleware key in the page's front matter:

If you want to use middleware for a group of pages, you can do so by chaining the middleware method after calling the Folio::path method.

Adding More Front Matter

You can add any additional front matter to your page. For example, you might want to add a title key to the page's front matter:

This will be passed as the $title variable to the view template. This applies to all front matter keys.

The Same Folio You Know and Love

Creating Subpages

To create a subpage in Folio, you need to make a new directory within an existing one. For example, if you want to create a page that can be accessed via /user/profile, you would create a profile.md template within the pages/user directory like this:

Setting a Default Page

Sometimes, you might want to set a specific page as the default for a directory. You can do this by placing an index.md or index.blade.md template within a Folio directory. Any requests to the root of that directory will then be directed to that page:

Using URL Segments in Your Page

There might be times when you need to use parts of the incoming request's URL in your page. For example, you might need to access the "ID" of a user whose profile is being displayed. To do this, you can include a segment of the page's filename in square brackets:

You can then use these captured segments as variables within your .blade.md template, or within the parent view component:

To capture multiple segments, you can prefix the encapsulated segment with three dots ...:

When capturing multiple segments, the captured segments will be injected into the page as an array:

Linking URL Segments to Models

If a wildcard segment of your page template's filename matches one of your application's Eloquent models, Folio will automatically link it to Laravel's route model binding capabilities and try to inject the resolved model instance into your page:

The captured models can then be accessed as variables within your .blade.md template or the parent view component. The model's variable name will be converted to "camel case":

Customizing the Model Key

If you want to link bound Eloquent models using a column other than id, you can specify the column in the page's filename. For example, a page with the filename [Post:slug].blade.md will try to link the bound model via the slug column instead of the id column.

Specifying the Model Location

By default, Folio will look for your model within your application's app/Models directory. However, if needed, you can specify the full model class name in your template's filename:

Writing PHP Code in Your File

If you need to write PHP code within your file, you must end it in a .blade.md.

You can then use the @php Blade directive:

Please note that in Folio, the ` tags are only for Folio page definition functions such asmiddleware andwithTrashed`, which are not supported by Folio Markdown at this time.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.


All versions of folio-markdown with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/console Version ^10.15|^11.0
illuminate/container Version ^10.15|^11.0
illuminate/contracts Version ^10.15|^11.0
illuminate/filesystem Version ^10.15|^11.0
illuminate/pipeline Version ^10.15|^11.0
illuminate/routing Version ^10.15|^11.0
illuminate/support Version ^10.15|^11.0
illuminate/view Version ^10.15|^11.0
laravel/folio Version ^1.0@beta
spatie/invade Version ^2.0
spatie/laravel-markdown Version ^2.3
spatie/laravel-package-tools Version ^1.14.0
spatie/yaml-front-matter Version ^2.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 snellingio/folio-markdown contains the following files

Loading the files please wait ...