How can I optimize my Laravel controller to avoid 504?

I’m trying to push around 3,000 items into a table – I’m not sure if its possible but I feel my controller could reach that level with some optimizations. It’s currently taking 60+ seconds and timing out. if ($request->has(‘items’)) { $queueData = []; foreach ($request->get(‘items’) as $item) { if ( QueueItem::where(‘item’, $item)->exists() || QueueItemFailed::where(‘item’, $item)->exists()…

Laravel WebSockets deployed: connection works, but subscribing to channels does not

Software: Laravel 5.8 Laravel WebSockets 1.1 Vue 2.6.10 Webserver: Debian 8 Plesk LetsEncrypt certificate In websockets.php (complete file) I have my local_cert and local_pk setup with my lets encrypt certificates. If I leave this option blank I cannot even connect. I also have set verify_peerto false, because if I don’t I cannot connect either. LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/usr/local/psa/var/modules/letsencrypt/etc/live/website.com/fullchain.pem…

Laravel relations doesn’t return anything

i have problem in laravel eloquent relationships. there is 2 model in my application: article and category. article model: public function category() { return $this->belongsToMany(‘App\Category’); } category model: public function article() { return $this->hasMany(‘App\Article’); } the relation between this tow is hasMany (Category -> article) & belongsToMany (Article -> category). category will fetch by requested…

hello guys am new to laravel testing and am getting no test execute i am using laravel 6.0 i have created database.sqlite if anybody has a clue please

this is my config/database will be if i can get prompt reply ‘connections’ => [ ‘sqlite’ => [ ‘driver’ => ‘sqlite’, ‘url’ => env(‘DATABASE_URL’), ‘database’ => env(‘DB_DATABASE’, database_path(‘database.sqlite’)), ‘prefix’ => ”, ‘foreign_key_constraints’ => env(‘DB_FOREIGN_KEYS’, true), ] …this is the phpunit.ml….. <testsuite name=”Feature”> <directory suffix=”Test.php”>./tests/Feature</directory> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist=”true”> <directory suffix=”.php”>./app</directory> </whitelist> </filter> <php> <server…

Laravel: Unable to JSON encode payload. Error code: 5

I’m working on Laravel (v5.7) app that converts uploaded CSV (with contacts) into array that is then passed as argument when job class is being dispatched. Here is the example of CSV file (format that is supported): 123456,Richard,Smith 654321,John,Doe Uploaded (CSV) file is handled like this: $file_path = $request->file_name->store(‘contacts’); $file = storage_path(‘app/’ . $file_path); $contactsIterator…