Laravel-Adminer icon indicating copy to clipboard operation
Laravel-Adminer copied to clipboard

themes

Open rebornishard opened this issue 8 years ago • 5 comments

how to include themes ? or at least provide responsive theme as default, thanks

btw great package, i'm stuck including adminer.php standalone

rebornishard avatar May 24 '16 05:05 rebornishard

Adminer is expecting the .css file in the same folder where it is being executed, so you can download any theme from adminer website and put it in your public folder (where index.php is located). Just leave the default name 'adminer.css' and you should see the theme applied.

I hope that's good enough for your case.

ergonomicus avatar Jul 02 '16 23:07 ergonomicus

@ergonomicus since i move default index to / so i must add adminer.css to dir / ? let me try it,

ok i try both on public/ and / , both of them none worked. i put adminer.css into attachment endorse.zip

btw adminer 1.2.5 released

rebornishard avatar Jul 07 '16 10:07 rebornishard

Having some trouble here too. I tried adding the adminer.css file to the laravel public folder, my public_html/ folder and into the composer package src directory without any luck. Love this package just want this theme added.

bkoch31 avatar Dec 15 '16 21:12 bkoch31

With 4.3.1, I adjusted the CSS as follows:

  1. Extend AdminerAutologinController
  2. Overwrite function index()
  3. In there, check if request()->query->get('file') equals default.css
  4. If yes, echo custom CSS (this is prepended before the adminer CSS, but there is no other way. You have to use !important)
  5. Call parent index() method

cweiske avatar Aug 01 '18 12:08 cweiske

Hi,

Here is my solution (based on @cweiske's idea):

  1. Create a new controller for adminer, include needed auth/acl middlewares (I want to wrap adminer with my normal ACL control).
  2. Add: use Illuminate\Support\Facades\Response;
  3. Create index function in the new controller:

` public function index() { // Manual override of CSS if (request()->query->get('file') == 'default.css') { // Location of css theme file $file = 'css/adminer/adminer-haeckel.css';

        // Retrieve contents of css file
        if (file_exists($file)) {
            $contents = file_get_contents($file);

            // Create response
            $response = Response::make($contents);

            // Set header to text/css
            $response->header('Content-Type', 'text/css');

            // Send response to client
            return $response;
        }
    }

    require('../vendor/miroc/laravel-adminer/src/adminer-4.5.0-en.php');
}

`

  1. Download CSS theme file from adminer. Copy content of default adminer css file (default.css) and add to the top of new theme file.

/r annoying code block feature...

jtallinger avatar Oct 11 '18 06:10 jtallinger