PHP code example of alanmburr / pagetitle

1. Go to this page and download the library: Download alanmburr/pagetitle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alanmburr / pagetitle example snippets


'providers' => [
    '...',
    Rephlux\PageTitle\PageTitleServiceProvider::class
];

 'aliases' => [
     '...'
     'PageTitle' => Rephlux\PageTitle\Facades\PageTitle::class,
 ]

public function index()
{
    \PageTitle::add('Welcome to our Homepage');

    return view('hello');
}

public function index()
{
    pagetitle('Welcome to our Homepage');

    return view('hello');
}

public function index()
{
    pagetitle([
        'About us',
        'Profile'
    ]);

    return view('hello');
}



return [

    /*
    |--------------------------------------------------------------------------
    | Page name
    |--------------------------------------------------------------------------
    |
    | Type your page name for your website.
    | This will be used when there are more titles to concatenate with.
    |
    */
    'page_name' => '',

    /*
    |--------------------------------------------------------------------------
    | Default title when empty
    |--------------------------------------------------------------------------
    |
    | This will be used when therer is no other title.
    | Mainly used for the home page of your website.
    |
    */
    'default_title_when_empty' => '',

    /*
    |--------------------------------------------------------------------------
    | Delimiter
    |--------------------------------------------------------------------------
    |
    | Titles will be concatenated using this delimiter.
    |
    */
    'delimiter' => ' :: ',
];

public function index()
{
    pagetitle('My Blog Post')->setPageName('My Blog')->setDelimeter(' / ');

    return view('hello');
}
bash
php artisan vendor:publish --provider="Rephlux\PageTitle\PageTitleServiceProvider"