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
0 answers
laravel 5 urlgenerator with Form::open route with Route Annotations
I'm using Laravel 5 with Route Annotations. (The app\Http\route.php will be automaticaly deleted). For video about Route Annotations, you may have a look at https://www.youtube.com/watch?v=sOvgw40Dg4A
I build a ContactController.php with php…

Galvion
- 1,353
- 7
- 23
- 35
0
votes
2 answers
Eloquent ORM object relashionship
i have two tables. School and Student.
When i fetch all Students
Student::all()->toJson();
I get a response with
[
{
"id": 1,
"school_id": 1,
"name": "Jhon"
}
]
But actually i would like to receive
[
{
"id": 1,
"school":…

Guilherme Miranda
- 1,052
- 2
- 10
- 19
0
votes
1 answer
How do you specify PHP version for Composer so that it won't download the latest builds?
I have shared hosting with PHP 5.3.8 where I cannot run Composer.
Yesterday I have installed Composer to my own computer and then I have "build" Restler with it. It has downloaded Illuminate too. Then I've uploaded them to my shared hosting and it…

ilhan
- 8,700
- 35
- 117
- 201
0
votes
1 answer
Mailing default error page in Laravel
On production server i would like to send myself an email every time an error ocurres. I'm now sending a basic mail but i would like to attach the rendered basic (orange) error page as a attached html file.
Any idea how to do that?
This is what i…

Jannick Vandaele
- 963
- 1
- 7
- 9
0
votes
0 answers
Laravel system returns NotFoundHttpException
My laravel 4 projects sometimes prints an error in error logs as following:
exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/html/projectname/bootstrap/compiled.php:5336 Stack trace: #0…

Onur
- 414
- 1
- 11
- 31
0
votes
1 answer
How to access values from this result
I'm newbie to Laravel and I'm doing my first steps on it. So I made this query:
public function getPaymentHistory($user_id)
{
return $this->where('created_by', '=', $user_id)->orderBy('created_at', 'desc')->get();
}
And this is the…

ReynierPM
- 17,594
- 53
- 193
- 363
0
votes
1 answer
How to use Illuminate database instance throughout required PHP files
I am trying to setup a restful API using Slim PHP. This is my first time using a microframework and I am trying to structure an application with it so it remains maintainable.
I am trying to structure my application like so:
root
- index.php
-…

Mat A
- 141
- 2
- 2
- 10
-1
votes
1 answer
Uncaught Error: Call to a member function connection() on null in php
I try to use the Eloquent without using Laravel in my project and
I'm getting this error
Uncaught Error: Call to a member function connection() on null
When I try to call some Eloquent methods.
For example the create method in my createTask…

Stanislav G.
- 1
- 4
-1
votes
1 answer
Using Illuminate Database outside Laravel without PHP Artisan Commands
I'm trying to set up database migrations using Illuminate's Database outside of a Laravel 4.2 project. Everything I'm reading online indicated that it is completely doable to use any Illuminate components outside of Laravel, but the difficulty I'm…
user3361594
-3
votes
1 answer
How can I modify DB structure in Laravel without truncating tables?
I have defined a DB table structure below.
If I want to modify a table column:
From
$table->string('active',1);
To:
$table->string('active',1)->nullable(); // allow null values
Every time I run the migration script, my tables will be truncated.
Is…

Luc Laverdure
- 1,398
- 2
- 19
- 36
-3
votes
2 answers
What's the PHP syntax for statement [$var1, $var2] = someMethod();?
I'm trying to get Illuminate/Database working on my PHP app and it's complaining on multiple occasions about code in the library that looks like this:
[$value, $key] = static::explodePluckParameters($value, $key);
And here's the error from the…

askepott
- 250
- 3
- 13
-3
votes
1 answer
Update where not exists except row's updating, using Illuminate database
I would like to update record and check if not exists in table, but the problem is if I check exists, it worked but I cannot even update the one record that I selected because it already exist.
Here my code
$app->post('/update_function',…

Teerpong Phothiphun
- 45
- 2
- 10