murdercode/laravel-admin-bar

Laravel Admin Bar

v1.0.5 2024-03-18 13:57 UTC

README

Latest Version on Packagist run-tests Fix PHP code style issues Total Downloads

A simple, but powerful, package for include an Admin bar (like Wordpress) in your next fantastic Laravel project.

Installation

You can install the package via composer:

composer require murdercode/laravel-admin-bar

You can publish the config file with:

php artisan vendor:publish --tag="admin-bar-config"

This is the contents of the published config file:

<?php

// config for Murdercode/LaravelAdminBar
return [
    'style' => [
        'show3labsLogo' => true,
        'theme' => 'dark', // 'light' or 'dark'
        'max-width' => '1200px',
        'position' => 'bottom', // 'top' or 'bottom'
        'font-size' => '14px',
    ],
    'config' => [
        'adminUrl' => '/cms',
        'editPost' => [
            'enabled' => true,
            'uris' => ['articoli/{slug}', 'notizie/{slug}', 'recensioni/{slug}'], // detect the current route as defined in your routes/web.php
            'wildcard' => 'slug', // the wildcard for the parameter (as over)
            'parameterForSearch' => 'slug', // the parameter to be used for search the post
            'model' => \App\Models\Post::class, // the model to be used for search the post
            'parameterToReturn' => 'id', // the value to be returned
            'targetEndpointUrl' => '/cms/resources/posts/{parameter}',
        ],
        'emptyCachePost' => [
            'enabled' => true,
            'uris' => ['articoli/{slug}', 'notizie/{slug}', 'recensioni/{slug}'], // detect the current route as defined in your routes/web.php
            'wildcard' => 'post', // the wildcard for the parameter (as over)
            'parameterForSearch' => 'slug', // the parameter to be used for search the post
            'model' => \App\Models\Post::class, // the model to be used for search the post
            'parameterToReturn' => 'id', // the value to be returned
            'targetEndpointUrl' => '/posts/{parameter}?nocache',
        ],
    ],
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel-admin-bar-views"

Usage

In any part of your layout you can include the admin bar using the following code:

{{LaravelAdminBar::render()}}

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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