PHP code example of tanthammar / laravel-extras

1. Go to this page and download the library: Download tanthammar/laravel-extras 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/ */

    

tanthammar / laravel-extras example snippets


//Filament placeholder field with translation string containing Markdown tags

Placeholder::make(trans('fields.accounting-chart'))
    ->disableLabel()
    ->content(new MarkdownToHtmlString(__('fields.account_hint')))
    ->columnSpan('full')

$assocArray = [
    'item_one'   => ['name' => 'One'],
    'item_two'   => ['name' => 'Two'],
    'item_three' => ['name' => 'Three'],
    'item_four'  => ['name' => 'Four'],
];
 
$newArray = Arr::swap($array, 'item_one', 'item_three');
 
/*
 * [
 *     'item_three' => ['name' => 'Three'],
 *     'item_two'   => ['name' => 'Two'],
 *     'item_one'   => ['name' => 'One'],
 *     'item_four'  => ['name' => 'Four'],
 * ]
 */
bash
php artisan vendor:publish --provider="Tanthammar\LaravelExtras\LaravelExtrasServiceProvider" --tag="migrations"