Download the PHP package aon2003/laravel-page-titles without Composer

On this page you can find all versions of the php package aon2003/laravel-page-titles. 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-page-titles

A simple package that makes it easier to set a page title in a Laravel application.

GitHub issues GitHub forks GitHub stars GitHub license Latest Version on Packagist GitHub Code Style Action Status Total Downloads

This simple package has only one purpose: compacting the job of setting page titles to a single file.

It makes available a global variable $page_title in all blade templates and views using a Middleware.

Support us

Buy Me A Coffee

Installation

You can install the package via composer:

Next, you need to publish a config file and a language file:

Lastly, you need to add the custom middleware to your web's middleware group in your app/Http/Kernel.php file.

Usage

For the library to work all your routes MUST be named. After the installation a global variable $page_title will be available in all blade components. It will contain the name of the current route, which will be used to match a title that you can configure in the translation file: lang/en/page_titles.php.

By default, the page_titles.php file contains only two default page titles for route names 'index' and 'home'.

You can add your custom titles by adding lines in this file like this:

Then, in your blade files you should add the following line so the titles are displayed:

Page titles with Variables

If you want to be able to pass variables to your page titles, you should pass them as an array to the view, add numbered placeholders to the title in the language files and change the <title> tag in the blade files:

page_titles.php:

Controller:

{page}.blade.php:

The resulting page title should be: Hello, Alex!

Translations file name

If you want, you could use different translation file name. The only thing you should do for it to work is to rename the translation files and change the translation_file_name variable in the page_titles.php config file to the file name you want to use.

page_titles.php:

Internationalization

If your project supports internationalization, you can simply add more {language_code}/page_title.php files to your lang folder. For more information check out the official Laravel docs.

Changelog

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

Credits

License

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


All versions of laravel-page-titles with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.13.0
illuminate/contracts Version ^9.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 aon2003/laravel-page-titles contains the following files

Loading the files please wait ....