Laravel-Adminer
Laravel-Adminer copied to clipboard
themes
how to include themes ? or at least provide responsive theme as default, thanks
btw great package, i'm stuck including adminer.php standalone
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 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
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.
With 4.3.1, I adjusted the CSS as follows:
- Extend
AdminerAutologinController
- Overwrite
function index()
- In there, check if
request()->query->get('file')
equalsdefault.css
- If yes, echo custom CSS (this is prepended before the adminer CSS, but there is no other way. You have to use
!important
) - Call parent
index()
method
Hi,
Here is my solution (based on @cweiske's idea):
- Create a new controller for adminer, include needed auth/acl middlewares (I want to wrap adminer with my normal ACL control).
- Add: use Illuminate\Support\Facades\Response;
- 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');
}
`
- 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...