Questions tagged [illuminate-container]

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.

117 questions
2
votes
2 answers

Fetching Single Model from Laravel Collection

Let's say you have an Illuminate Collection of User model objects. $users = User::all(); Now, you want to get a single user from that collection by ID. The only way I knew of doing this (super ugly): $user_id = 22; $user =…
Leng
  • 2,948
  • 2
  • 21
  • 30
2
votes
3 answers

How to use Illuminate Database Query Builder & Eloquent in other framework with PHP 5.3.x

I did a couple of projects with Laravel in the past but now I need something very light for a project and went to use Slim, it works great for what I need and I want the great Eloquent ORM and Query Builder of Laravel, can't go without it now :) Now…
ghiscoding
  • 12,308
  • 6
  • 69
  • 112
1
vote
2 answers

Method Illuminate\Validation\Validator::validateVideo does not exist. Can't fix

I get this error after submitting the form. Here's the controller code. The error appears to be in the validate() part. public function store(Request $request) { $video = new Video(); $request->validate([ 'title' =>…
Kida
  • 17
  • 3
1
vote
0 answers

How to use Illuminate\Support\ServiceProvider in standalone application?

I am calling the register method of the respective service provider, but the actual boot method is not firing and ultimately not triggering the observer. $app = new \Illuminate\Container\Container(); $app['app'] = $app; with(new…
1
vote
1 answer

Laravel Valet - deprecated dependencies in lock file

On running composer global require laravel/valet, illuminate/contracts and illuminate/container are locked to v5.4.36: - Locking illuminate/container (v5.4.36) - Locking illuminate/contracts (v5.4.36) Running any valet command returns a long…
1
vote
0 answers

Deprecated: Method ReflectionParameter::getClass() is deprecated in Laravel Illuminate Container.php

I recently tried creating a new Laravel project using the laravel new command and going to the {projectname}.test domain returns the error Deprecated: Method ReflectionParameter::getClass() is deprecated in…
uncafenoir
  • 11
  • 2
1
vote
1 answer

Is there a way to send params to an observer?

Is there a way to send parameters to an Observer in Eloquent ORM? Based on laravel's documentation: User::observe(UserObserver::class); observe method receive a class, not an instance of an object. So I cant do something like: $observer = new…
Pipe
  • 2,379
  • 2
  • 19
  • 33
1
vote
2 answers

Illuminate - HasMany - Iteration

I am just doing my first exercises with Illuminate (Laravel) on my currently handmade database and website. I would like to improve by using MVC and found Illuminate interesting to use for the interaction with my database. I worked the day on this…
Tim K.
  • 335
  • 4
  • 23
1
vote
3 answers

Laravel's Illuminate paginator can't find query string

I'm working on a old PHP project, that is running in legacy SQL query, which is good but I like to use query builders like Laravel Illuminate SQL package! So i have added all required package dependencies to run Illuminate SQL, and this query…
rakibtg
  • 5,521
  • 11
  • 50
  • 73
1
vote
0 answers

Laravel: Get instance of Illuminate\Database\Capsule\Manager

I'm looking to encapsulate functionality that can be integrated into both a Laravel 5.6 webapp and a PHP-based command-line application. The functionality involves database interactivity. For the sake of modularity, I decided to implement this…
Chris Allen Lane
  • 6,334
  • 5
  • 25
  • 31
1
vote
3 answers

Add one more option in select element using Illuminate\html

I have a create method like this: public function create() { $categories = App\CategoryModel::pluck('name', 'id'); return view('posts.create', compact('categories')); } and I want to add some options to select element using…
Tai Le
  • 493
  • 1
  • 4
  • 14
1
vote
0 answers

Dingo API pagination with illuminate builder not eloquent

I am in the process of starting to learn Laravel 5.3 and Dingo API to build a basic REST API. I am trying to return the paginated JSON representation of a report query result. I can get pagination to work using Eloquent models, however not when…
Cody Mays
  • 127
  • 1
  • 9
1
vote
1 answer

Does Laravel 5.3019 database Transaction method work?

I've use Larvel 5.0 with Database transaction all the method in my previous web application it work as well and we are really love it because this application help me much more than our estimated so we have create another webs application by using…
DMS-KH
  • 2,669
  • 8
  • 43
  • 73
1
vote
1 answer

Illuminate Database connectivity with mysql router

I'm using Laravel's illuminate database library outside laravel with jessengers mongodb. My requirement is multiple database connectivity through illuminate database. Currently, I've added two connection one mysql and one mongodb. To split the…
Haridarshan
  • 1,898
  • 1
  • 23
  • 38
1
vote
1 answer

How to insert if not exist illuminate slim framework

I use slim framework and use illuminate/database. I would like to insert data which not duplicate function_number but if different product_id function_number can be duplicate, for example here is my mode $app->post('/create_function',…