PHP code example of acharsoft / laravel-adminlte-rtl

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

    

acharsoft / laravel-adminlte-rtl example snippets


    acharsoft\LaravelAdminLte\ServiceProvider::class,
    

use Illuminate\Notifications\Notifiable;
use Yadahan\AuthenticationLog\AuthenticationLogable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, AuthenticationLogable;
}

'menu' => [
    'MAIN NAVIGATION',
    [
        'text' => 'Blog',
        'url' => 'admin/blog',
    ],
    [
        'text' => 'Pages',
        'url' => 'admin/pages',
        'icon' => 'file'
    ],
    [
        'text' => 'Show my website',
        'url' => '/',
        'target' => '_blank'
    ],
    'ACCOUNT SETTINGS',
    [
        'text' => 'Profile',
        'route' => 'admin.profile',
        'icon' => 'user'
    ],
    [
        'text' => 'Change Password',
        'route' => 'admin.password',
        'icon' => 'lock'
    ],
],

[
    [
        'header' => 'BLOG',
        'can' => 'manage-blog'
    ],
    [
        'text' => 'Add new post',
        'url' => 'admin/blog/new',
        'can' => 'add-blog-post'
    ],
]

[
    [
        'header' => 'BLOG',
        'can' => 'manage-blog'
    ],
    [
        'text' => 'Add new post',
        'url' => 'admin/blog/new',
        'permission' => ['admin']
    ],
    [
            'text' => 'Add new comment',
            'url' => 'admin/blog/new/comment',
            'permission' => ['admin','master','user']
    ],
]



namespace MyApp;

use acharsoft\LaravelAdminLte\Menu\Builder;
use acharsoft\LaravelAdminLte\Menu\Filters\FilterInterface;
use Laratrust;

class MyMenuFilter implements FilterInterface
{
    public function transform($item, Builder $builder)
    {
        if (isset($item['permission']) && ! Laratrust::can($item['permission'])) {
            return false;
        }

        return $item;
    }
}

'filters' => [
    acharsoft\LaravelAdminLte\Menu\Filters\ActiveFilter::class,
    acharsoft\LaravelAdminLte\Menu\Filters\HrefFilter::class,
    acharsoft\LaravelAdminLte\Menu\Filters\SubmenuFilter::class,
    acharsoft\LaravelAdminLte\Menu\Filters\ClassesFilter::class,
    //acharsoft\LaravelAdminLte\Menu\Filters\GateFilter::class, Comment this line out
    MyApp\MyMenuFilter::class,
]

use Illuminate\Contracts\Events\Dispatcher;
use acharsoft\LaravelAdminLte\Events\BuildingMenu;

class AppServiceProvider extends ServiceProvider
{

    public function boot(Dispatcher $events)
    {
        $events->listen(BuildingMenu::class, function (BuildingMenu $event) {
            $event->menu->add('MAIN NAVIGATION');
            $event->menu->add([
                'text' => 'Blog',
                'url' => 'admin/blog',
            ]);
        });
    }

}

    public function boot(Dispatcher $events)
    {
        $events->listen(BuildingMenu::class, function (BuildingMenu $event) {
            $event->menu->add(trans('menu.pages'));

            $items = Page::all()->map(function (Page $page) {
                return [
                    'text' => $page['title'],
                    'url' => route('admin.pages.edit', $page)
                ];
            });

            $event->menu->add(...$items);
        });
    }

[
    'text' => 'Pages'
    'url' => 'pages',
    'active' => ['pages', 'content', 'content/*']
]

'plugins_js' => [
        'pace'    => 'plugins/pace/pace.min.js',
        ],
'plugins_css' => [
        'pace'    => 'plugins/pace/pace.min.css',
        ],


class AppServiceProvider extends ServiceProvider
{

    public function boot()
    {
        Blade::directive('links',function ($expression){
                    return "  echo '<link rel=\'stylesheet\' href=\''.asset(config ('adminlte.plugins_css.'.$expression)).'\'>'; 

'google' => [
    'client_id'     => env('GOOGLE_CLIENT_ID'),
    'client_secret' => env('GOOGLE_CLIENT_SECRET'),
    'redirect'      => env('GOOGLE_REDIRECT')
],

    php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=assets
    

    php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=assets --force
    

php artisan make:adminlte

php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=config

php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=migrations

php artisan migrate

php artisan view:clear

php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=translations

php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=views

/**
  * Redirect the user to the Google authentication page.
  *
  * @return \Illuminate\Http\Response
  */
public function redirectToProvider()
{
    return Socialite::driver('google')->redirect();
}