Download the PHP package paulund/content-markdown without Composer

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

Content Markdown

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


Table of Contents

This Laravel pattern with allow you to add a lightweight CMS to your Laravel application. This package will allow you to create markdown files in your Laravel application and then display the content on the front end of your website.

It works by writing in markdown files and then index the slug into the database. This will allow you to query on this slug to get the content of the markdown file.

Installation

Install the package via composer:

Publish the configuration file:

Setup

Add Filesystem Disk

Add the following to your config/filesystems.php file:

This means you need to create a folder in the storage directory called content where you can store your markdown files.

You can also add sub categories to the content folder to organise your markdown files.

Setup Database Configuration

Content markdown consists of 3 database tables, content, tags and content_tags. You can create these tables by running the migration:

In the config file you can customise the database table names.

Draft Posts

There are a few ways that you can define a post as a draft.

You can customise the prefix in the config file.

Commonmark Configuration

This package uses commonmark to parse the markdown files. You can customise the configuration of commonmark in the config file.

Content Properties

Usage

Index Command

The index command will take the markdown files in the filesystem disk and index the file in the database.

Whenever a new markdown files is created you can run this command to index the file.

This will also run nightly to ensure the index stays up to date.

Get All Content

In order to display all of the content you can use the Content model to fetch the content.

Get All Content In Folder

You can organise your markdown files into different folders in the filesystem disk. You can query the content by folder.

Get The Latest 10 Content

You can limit the number of content that is returned by using the limit method.

Get Content By Slug

You can query the content by the slug of the markdown file.

Get Content By Tag

You can query the content by the tag of the markdown file.

Populate Content

Once you have found your content model in the database you can populate it with the content of the markdown file by using the populate method.

Content Cache

Whenever you make a request the application will need to lookup the database but the slug of the file, then lookup the markdown file, then parse the markdown to display it. This can add some latency to the request. To speed up the request you can cache the content using the CacheResponse middleware.

This will cache the response for 1 hour using the file store.

If you want to customise the cache settings you can change the store and the ttl.

By default content cache is enabled, but there is a config option to disable it, in your .env file you can add:

Testing

Credits

License

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


All versions of content-markdown with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^10.0||^11.0
spatie/commonmark-shiki-highlighter Version ^2.4
symfony/yaml Version ^7.1
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 paulund/content-markdown contains the following files

Loading the files please wait ....