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
3
votes
2 answers
Laravel 6 config()->get('database.connections.mysql') not matching DB:connection()
Prerequisites
In my local environment I am working with multiple tenants and Redis (Auth required).
To serve the project I am using Valet.
For this case I am addressing these two connections:
- basic_foo (is defined in my .env)
- tenant_foo (is…

leopold
- 1,971
- 1
- 19
- 22
3
votes
1 answer
How to create database connection as instance of instance of Illuminate\Database\ConnectionInterface in Illuminate library?
I am developing a restful application in slim framework. I am using a session manager which uses database library of illuminate. It requires me to create a database connection using instance of Laravel's illuminate. But I am getting an error. Here…

Daniel
- 269
- 6
- 16
3
votes
1 answer
Laravel 5.2, LaravelCollective 5.2, Class 'Html' not found
I followed these steps but still getting "Html" class not found.
added in composer.json
"require": {
"laravelcollective/html": "5.2.*"
}
once installed, added these lines in config/app.php
'providers' => [
// ...
…

Qazi
- 5,015
- 8
- 42
- 62
3
votes
0 answers
illuminate packages outside laravel
I am new to Laravel, I use almost all L5 packages outside Laravel. But I have some problems to make these work.
This is my composer.json file:
{
"require": {
"slim/slim": "2.*",
"zeuxisoo/slim-whoops": "0.2.0",
…

giorgos
- 1,771
- 4
- 15
- 14
3
votes
2 answers
Laravel cache outside of laravel
I've currently got laravel illuminate database and eloquent working outside of laravel.
I'm now trying to get the cache working as well.
This is what I have altogether now.

David
- 34,836
- 11
- 47
- 77
3
votes
3 answers
Using illuminate/pagination outside laravel
I'm building custom project and for now for database connection i used illuminate/database the eloquent model.
But i need samo pagination to continue my development i installed via composer illuminate/pagination and i cant configure it propertly i…

mstojanov
- 175
- 4
- 17
3
votes
1 answer
Laravel/Illuminate Fatal Error
I got a web app that works on my local computer, but not on my server. I get this error on server. I checked the code that the error mentions about, and there's nothing wrong with it.
Do you have any idea what causes this?
Thank you very much in…

citizen_of_noobville
- 327
- 7
- 21
2
votes
1 answer
How to get phpstan to infer the type for my Laravel Collection pipeline?
Given my class
> $collection
*
* @return Collection
*/
public…

k0pernikus
- 60,309
- 67
- 216
- 347
2
votes
0 answers
How can I pass a PDO object to an Illuminate Capsule Manager
I'm using Cartalyst's Sentinel user package as part of a user login library w/ a gui that I'm making. Sentinel uses Illuminate for the database.
So to set up the connection I have to do something like:
$capsule = new…

Reed
- 14,703
- 8
- 66
- 110
2
votes
0 answers
Eloquent 5.5 paginate() not working outside laravel
I am using Illuminate/database package outside Laravel with my CodeIgniter setup. The initialization is done using Capsule class like this
use Illuminate\Database\Capsule\Manager as CapsuleManager;
use Illuminate\Events\Dispatcher;
use…

Ehs4n
- 762
- 1
- 8
- 24
2
votes
2 answers
What happened to Laravel's Eloquent public static function "create" in Model.php?
In previous versions of Laravel 5.x (I'm not sure when it was changed) I was able to call static method create on any Eloquent Model class to insert records into a database.
For example:
EloquentUser::create([
'name' => self::ADMIN_NAME,
…

Matt Komarnicki
- 5,198
- 7
- 40
- 92
2
votes
2 answers
Illuminate Eloquent return null relation on a relation returning different objects
I have an object in Illuminate that has a relation that can return different objets depending on a property of the main object
public function relation(){
switch($this->type){
case "type_1":
return…

David Rojo
- 2,337
- 1
- 22
- 44
2
votes
0 answers
Laravel Model Factory get Same ID
How to get the same model id i tried this not working.
$factory->define(App\Item::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'color' => $faker->color_name,
'position' =>…

Douglass
- 49
- 4
2
votes
1 answer
Lumen MySQL query not handling UTF8 value as expected
I'm working against a database that is using UTF8 encoding and has many user names that contain special characters, such as "Ғђ ▫ Sony"
When querying the user table, Lumen responds with incorrect data. I've tried querying the same table using mysqli…

Sean Walsh
- 8,266
- 3
- 30
- 38
2
votes
0 answers
Defining Illuminate Database without Laravel
I'm a little confused about how to use Illuminate Database in my project. I have found two ways to use it, but can't figure out which one is the best/right way.
Solution 1:
This is the content of my database.php:
require('vendor/autoload.php');
use…

sjosen
- 551
- 1
- 6
- 10