miroc / Laravel-Adminer

Adminer wrapper for Laravel 5
58 stars 24 forks source link

PHP 7.2 Warning count(): Parameter must be an array or an object that implements Countable #20

Closed juancarlosestradanieto closed 6 years ago

juancarlosestradanieto commented 6 years ago

When I click on foreign key id in a table the browser crash and laravel throws an exception in adminer-4.3.1-en.php (line 1808). I think it is solved in new versions of adminer, so it would be fine if the versión of adminer is updated in this páckage.

proseLA commented 6 years ago

i experienced the same error when adding a new item. using php7.2.

juancarlosestradanieto commented 6 years ago

Hi, i solved my problem updating the adminer version in my vendor folder following some steps: 1 - Clone Adminer git project 2 - Replace in all project the functions that have conflict with Laravel : view, cookies and redirect and prefixed them with 'adm_' prefix. 3 - In the project in the file compile.php I commented the line $file = php_shrink($file); so the compiled file won't be minified. 4 - At the end of compile.php I added this line file_put_contents("adminer.php", $file); because I don't know where the compile proccess put the file, and after this the file will be generated in the same folder besides compile.php 5 - Run compile.php, may be in the browser or in the terminal. Now the file adminer.php has been generated. 6 - Take the file adminer.php and put it in the vendor folder of your project
vendor/miroc/laravel-adminer/src/adminer.php 7 - edit the file vendor/miroc/laravel-adminer/src/AdminerController.php and replace the name of the file which is required by adminer.php

At least it worked for me.

proseLA commented 6 years ago

worked for me too! thanks.

juancarlosestradanieto commented 6 years ago

Great! You're welcome.

proseLA commented 6 years ago

in looking at the PRs for this repository, it seems someone had already made the changes (for 4.5.0), but the author seems to be MIA.

TimoStahl commented 6 years ago

@miroc please merge #17

miroc commented 6 years ago

Sorry guys for late answer, I just merged the request.