Exception

Error

We're sorry, but an unhandled error occurred. Please see the details below.

array_rand(): Argument #1 ($array) must be of type array, October\Rain\Support\Collection given

~/plugins/businessbecause/news/controllers/http/controllers/News.php line 1340

            $resources_guides_status = true;
            $resources_guides_count = count($resources_guides_query);
            $resources_guides = $resources_guides_query;
 
 
            if (count($resources_guides) > 3) {
                $resources_guides = array_rand($resources_guides,3);
            }
 
            foreach ($resources_guides as $key => $value) {
                if ($current_user == null) {
 
                    $register_campagin_record = $Enrol_M->retrieveEnrolFormPageRecordByResourcesGuideRecordId($value->id);

Stack trace

# Called Code Document Line
42 array_rand() ~/plugins/businessbecause/news/controllers/http/controllers/News.php 1340
41 BusinessBecause\News\Controllers\Http\Controllers\News->view_article() ~/plugins/businessbecause/news/components/Article.php 143
40 Businessbecause\News\Components\Article->loadPost() ~/plugins/businessbecause/news/components/Article.php 38
39 Businessbecause\News\Components\Article->onRun() ~/modules/cms/classes/CmsCompoundObject.php 179
38 Cms\Classes\CmsCompoundObject->runComponents() ~/modules/cms/classes/Controller.php 501
37 Cms\Classes\Controller->execPageCycle() ~/modules/cms/classes/Controller.php 389
36 Cms\Classes\Controller->runPage() ~/modules/cms/classes/Controller.php 222
35 Cms\Classes\Controller->run() ~/modules/cms/classes/CmsController.php 50
34 Cms\Classes\CmsController->run() ~/vendor/laravel/framework/src/Illuminate/Routing/Controller.php 54
33 Illuminate\Routing\Controller->callAction() ~/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php 45
32 Illuminate\Routing\ControllerDispatcher->dispatch() ~/vendor/laravel/framework/src/Illuminate/Routing/Route.php 219
31 Illuminate\Routing\Route->runController() ~/vendor/laravel/framework/src/Illuminate/Routing/Route.php 176
30 Illuminate\Routing\Route->run() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 681
29 Illuminate\Routing\Router->Illuminate\Routing\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 130
28 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/plugins/rainlab/translate/classes/LocaleMiddleware.php 29
27 RainLab\Translate\Classes\LocaleMiddleware->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
26 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php 41
25 Illuminate\Routing\Middleware\SubstituteBindings->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
24 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php 49
23 Illuminate\View\Middleware\ShareErrorsFromSession->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
22 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php 56
21 Illuminate\Session\Middleware\StartSession->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
20 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php 37
19 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
18 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php 67
17 Illuminate\Cookie\Middleware\EncryptCookies->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
16 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 105
15 Illuminate\Pipeline\Pipeline->then() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 683
14 Illuminate\Routing\Router->runRouteWithinStack() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 658
13 Illuminate\Routing\Router->runRoute() ~/vendor/laravel/framework/src/Illuminate/Routing/Router.php 624
12 Illuminate\Routing\Router->dispatchToRoute() ~/vendor/october/rain/src/Router/CoreRouter.php 31
11 October\Rain\Router\CoreRouter->dispatch() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 170
10 Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 130
9 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php 63
8 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() ~/vendor/october/rain/src/Foundation/Http/Middleware/CheckForMaintenanceMode.php 23
7 October\Rain\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
6 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/plugins/offline/clockwork/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkMiddleware.php 29
5 Clockwork\Support\Laravel\ClockworkMiddleware->handle() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 171
4 Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() ~/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php 105
3 Illuminate\Pipeline\Pipeline->then() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 145
2 Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 110
1 Illuminate\Foundation\Http\Kernel->handle() ~/index.php 43