The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It also serves as the database layer of the Laravel PHP web application framework.
Questions tagged [illuminate-container]
117 questions
0
votes
2 answers
illuminate/bus packages were not loaded, likely because it conflicts with another require
Lavavel & PHP versions:
Laravel: 7
PHP: 7.4.30
I am trying to install pbmedia/laravel-ffmpeg package using composer like so:
composer require pbmedia/laravel-ffmpeg
On the first try the error message was this:
Problem 1
-…

The Blind Hawk
- 1,199
- 8
- 24
0
votes
1 answer
Laravel Illuminate Testing method for refreshing DB only at the start
I have a code that runs everyday and deletes some information from the database.
I am trying to test this code using artisan's test functionality and would like to be able to see the final result on phpmyadmin, however if I add…

The Blind Hawk
- 1,199
- 8
- 24
0
votes
1 answer
Error handler does not display custom error logs
I am trying to use the custom error handler in slim 4, but it still seems to be using the PHP built in one, here's an output of the error.
This is what I have tried so far from here
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true,…

SamHoque
- 2,978
- 2
- 13
- 43
0
votes
1 answer
Avoiding n queries on API list call for database-calculated model attributes
I am cleaning up a quite messy php laravel 8 project right now.
Currently my ressource looks like this:
class MyModelSimpleResource extends JsonResource
{
public function toArray($request)
{
return [
'id' => $this->id,
…

Ron
- 22,128
- 31
- 108
- 206
0
votes
0 answers
AWS RDS Postgres extremely slow when query from local php server
At my office, we have a php server and also a postgresql server.
The php server querying local postgresql server is fast, but recently we are migrating the db to AWS RDS.
And now we run a simple query from the php server to AWS RDS can take like 30…

Richard
- 1
0
votes
1 answer
Laravel: Pass data from Database/Controller into RouteServiceProvider.php
my question is if it is possible to pass data into the RouteServiceProvider.php file from the database with or without the controller. If so, could you tell me if my code below is correct.
What I am trying to pass into my RouteServiceProvider is a…

SpencerKMedia
- 33
- 9
0
votes
0 answers
Laravel7 phpunit View:with unable to pass tests
What is the proper syntax for "shouldReceive" with Laravel View class and the "with" argument? I have been trying all morning to let this simple test pass:
$request = new Request([], [], [], [], []);
$view = Mockery::mock(View::class);
…

caro
- 863
- 3
- 15
- 36
0
votes
0 answers
How to force data type maddping for select using Mysql and Illuminte Query Builder
I need to create a select query using Illuminate QB and Mysqsl specifying the data type of some column:
$data=DB:table("mytable")->select(["id","isValid"])->get();
With the current configuration the "isValid" field is mapped as a string of value…

Tobia
- 9,165
- 28
- 114
- 219
0
votes
1 answer
Illuminate query builder, how to convert dates to Carbon object
Is there any chance to use Illuminate Query builder to get dates as Carbon objects instead of strings?
For example:
$user=DB::table('users')->select(["id","lastLogin"])->where("id",1)->first();
$user->lastLogin; // <--- Carbon instead of string!

Tobia
- 9,165
- 28
- 114
- 219
0
votes
1 answer
Lavarel Illuminate class for mail reset not found
I made a notification class as MailResetPasswordNotification and edited the mail representation of the notification with the following.
public function toMail($notifiable)
{
$link = url("/password/reset/?token=".$this->token);
return (new…

Elementor
- 57
- 7
0
votes
0 answers
Docker LAMP image mysql connection issues
Im trying to create docker LAMP stack image and running into a few issues with the DB connectivity. I can hit static pages on the localhost after running the container which tells me the actual image is fine but I can't figure out why the db isn't…

bos570
- 1,505
- 2
- 23
- 45
0
votes
1 answer
Error when run artisan command in old projects and working fine for newly crated projects of Laravel
Getting uncertain error i.e
[![Parse error: syntax error, unexpected '=' in D:\xampp\htdocs\pilotRH\vendor\laravel\framework\src\Illuminate\Support\Arr.php on line 388][1]][1]
When I run artisan command in my old projects and then I test the same…

kantsverma
- 606
- 1
- 11
- 31
0
votes
1 answer
How can i get all tables where comma values are contained in group_concat() from LEFT JOINS in raw Msql or with Eloquent?
So far i have tried this approach which seems to be getting all the rows i want except for the part where i am doing the REGEXP
SELECT p.id
FROM package AS p
LEFT JOIN myservice AS s ON s.package = p.id
WHERE s.category IN (17,7,13,3,4,60,8)…

jhon dano
- 660
- 6
- 23
0
votes
5 answers
How to output table data from controller to view?
I'm in the beginning stages of trying to make sense of Laravel and am having trouble displaying the 'illuminate collection object' passed to a blade from a controller.
My print_r is outputting "Illuminate\Support\Collection Object (…

V1xIII
- 169
- 1
- 4
- 14
0
votes
1 answer
Eloquent 5.7: Creation-Event
I would like to automate the allocation of data to a property (i.e. customized ID-number) as soon as a new item has been created.
I understood that the example given in the next box is unfortunally not possible anymore with Eloquent 5.7!
Not…

Tim K.
- 335
- 4
- 23