PHP code example of clarkwinkelmann / flarum-local-extenders

1. Go to this page and download the library: Download clarkwinkelmann/flarum-local-extenders 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/ */

    

clarkwinkelmann / flarum-local-extenders example snippets


(new ClarkWinkelmann\LocalExtenders\AlterExtensionListInAdmin())
    ->extension('flarum-markdown', function ($extension) {
        // To Hide the extension completely
        $extension->hide();
        
        // To hide select information or buttons
        $extension->hideVersion();
        $extension->hideSettings();
        
        // To change the look
        $extension->title = 'New title';
        $extension->description = 'New description';
        $extension->iconName = 'fas fa-tree';
        $extension->iconColor = '#aa0000';
        $extension->iconBackgroundColor = '#aa0000';
        $extension->iconImage = __DIR__.'/path/to/image.png'; // SVG/PNG/JPG
        
        // You can also chain calls via the methods
        $extension
            ->title('New title')
            ->iconName('fas fa-tree');
    }),

new ClarkWinkelmann\LocalExtenders\FollowAfterStart(),

new ClarkWinkelmann\LocalExtenders\FollowAfterStart(false),

(new ClarkWinkelmann\LocalExtenders\FrontendWithoutModule('admin'))
    ->js(__DIR__.'/local/one-file.js')
    ->js(__DIR__.'/local/one-other-file.js')
    ->css(__DIR__.'/local/you-can-also-import-css-but-its-identical-to-the-core-extender.less'),

new ClarkWinkelmann\LocalExtenders\HideExtensionVersionInAdmin(),

new ClarkWinkelmann\LocalExtenders\HideFlarumVersionInAdmin(),

new ClarkWinkelmann\LocalExtenders\HideSystemInfoInAdmin(),

(new ClarkWinkelmann\LocalExtenders\OverrideSettings())
    ->set('mail_driver', 'log')
    ->set('forum_title', 'Hello'),

(new ClarkWinkelmann\LocalExtenders\OverrideSettings())
    ->hide('mail_driver'),

new ClarkWinkelmann\LocalExtenders\OverrideSettings([
    'fof-stopforumspam.ip' => '1',
    'fof-stopforumspam.email' => '0',
    'fof-stopforumspam.api_key' => 'abcdefg',
]),

new ClarkWinkelmann\LocalExtenders\RememberMeByDefault(),

(new ClarkWinkelmann\LocalExtenders\ReplaceAdminComponentViewWithHtml())
    ->string('MailPage', '<p>We have already configured email for you</p>'),

(new ClarkWinkelmann\LocalExtenders\ReplaceAdminComponentViewWithHtml())
    ->file('MailPage', __DIR__.'/local/mail.html'),