It happens because of in PHP 7.2 NULL in count() return Warning.
You can try to change
count($admin)
to
count((is_countable($admin)?$admin:[]))
More Related Contents:
- Get first and second element of array [duplicate]
- What are these exactly?: Composer, Git and Pyrus [closed]
- Getting particular object
- Laravel combined OR AND Solution
- Property Property Property [title] does not exist on this collection instance does not exist on this collection instance does not exist on this collection instance
- Laravel 5 – How to access image uploaded in storage within View?
- Laravel Eloquent Query Using WHERE with OR AND OR?
- Download files in laravel using Response::download
- Laravel update model with unique validation rule for attribute
- Sorting Laravel Collection via Array of ID’s
- Laravel – htmlspecialchars() expects parameter 1 to be string, object given
- What does “Mass Assignment” mean in Laravel?
- Laravel Eloquent display query log
- Laravel Checking If a Record Exists
- SQLSTATE[42S22]: Column not found: 1054 Unknown column – Laravel
- Accessing Laravel .env variables in blade
- Why do I have to run “composer dump-autoload” command to make migrations work in laravel?
- change the date format in laravel view page [duplicate]
- Laravel 5 hasMany relationship on two columns
- Laravel 5.2 Auth not Working
- Laravel 5 – Clear Cache in Shared Hosting Server
- Laravel: Validation unique on update
- Laravel 5 change public_path()
- Laravel Recursive Relationships
- Laravel Eloquent – Attach vs Sync
- Fatal error: Class ‘Illuminate\Foundation\Application’ not found
- How to Validate on Max File Size in Laravel?
- SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
- Laravel SQLSTATE[HY000] [2002] Connection refused
- Custom validator in Laravel 5