Questions tagged [laravel-4]

Laravel 4.2 is the previous version of the open-source PHP web development MVC framework created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax.

Laravel 4.2 is the previous version of the open-source for web development created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax.

New Features Overview

  • All pieces have been decoupled into independent components, collectively called Illuminate
  • integration
  • Driver-based view system
  • Better integration with cloud storage
  • collections

Resources

See also the tag for general laravel based questions, from past versions.

Social Media

14441 questions
5
votes
2 answers

Laravel 4 validation email unique constraint

I'm writing a Laravel 4 app that has a users table with the usual contact info. In my users model, my validation for the email specifies 'email'=>'required|email|unique:users', which works fine when registering new users. My question is how to…
user101289
  • 9,888
  • 15
  • 81
  • 148
5
votes
2 answers

Laravel How to update one to one relationships?

Terms table: term_id name slug Term_taxonomy table: term_taxonomy_id term_id description My Term model: public function TermTaxonomy(){ return $this->hasOne('TermTaxonomy'); } My TermTaxonomy model: public function Term(){ return…
Dark Cyber
  • 2,181
  • 7
  • 44
  • 68
5
votes
1 answer

What does --prefer-dist mean when using create-project to install laravel4?

What does --prefer-dist mean when using create-project to install laravel4?
Will
  • 633
  • 11
  • 26
5
votes
1 answer

Laravel extend package class

I added a cart package to my Laravel install, but I need to add a method to the class. If I modify the class directly, will my changes be overwritten when I update to a newer version? If so, what's the best method for modifying a package without…
Jordan Bundy
  • 159
  • 2
  • 6
5
votes
1 answer

Laravel 4 Eager Loading constraints

I want to get all Items (topics) WITH their comments, if comments user_id = $id. I try something like this, but it isn't working. So if Item hasn't got any comment with user_id = $id, then I don't need this Item. In DiscussionsItem model I have…
user3921996
  • 149
  • 1
  • 1
  • 9
5
votes
1 answer

Laravel Eloquent: getting id field of joined tables in Eloquent

I need to get the id of a second table. I cannot avoid using a INNER JOIN since I have to ORDER the results by a column in the second table. Here are my 2 tables events id name .... date ... myevents id meeventID meresults .... To…
Edwin Krause
  • 1,766
  • 1
  • 16
  • 33
5
votes
2 answers

Autocomplete text field in laravel using database

I am trying to make a autocomplete form like below but the form do not show the suggestion as my database query is ok. Form cole: Controller method code: Routes: When I search on the link I get the query result like this: Shows the…
SOURAV
  • 314
  • 3
  • 4
  • 15
5
votes
1 answer

$job->release() is not putting back on queue

Very new to queues so be gentle. To my understanding, $job->release() is supposed to put the job back on the queue. I currently have the code below but it only runs the job through the queue once. I need to be able to run it through up to 5 times…
Dylan Buth
  • 1,648
  • 5
  • 35
  • 57
5
votes
1 answer

What is the meaning of $1 and $2 in the Blade::extend function

I saw this example in the Laravel Docs: Blade::extend(function($view, $compiler) { $pattern = $compiler->createMatcher('datetime'); return preg_replace($pattern, '$1format(\'m/d/Y H:i\'); ?>', $view); }); but I don't seem to…
Mohamed Mo Kawsara
  • 4,400
  • 2
  • 27
  • 43
5
votes
3 answers

Laravel PHP: multiple project run at the same time

I want to run multiple laravel frame work project at the same time.Exactly how to do it I dont know. I used a command : php artisan serv --port=8080 , to run another project at port 8080. when I use this command into the cmd it shows the…
SOURAV
  • 314
  • 3
  • 4
  • 15
5
votes
1 answer

Blade template yield with default include

Is it possible to yield to another view but then default with an include statement? Example: @yield('header', @include('partials.header')) The intended action is that if the subview does not include the header, then the current template will…
Geoff
  • 377
  • 3
  • 13
5
votes
1 answer

What's the correct way to provide default values for Laravel model fields outside of MySQL?

I have a Laravel model which has various fields that default to NULL in the database and cannot easily be changed for legacy reasons. I would like to always return these as an empty string, for example, when returning JSON back from my route. Is…
Runcible
  • 3,008
  • 3
  • 19
  • 19
5
votes
2 answers

How do I solve "Target [Interface] is not instantiable" in Laravel 4?

My error message: Illuminate \ Container \ BindingResolutionException Target [Project\Backend\Service\Validation\ValidableInterface] is not instantiable. I understand that interfaces and abstract classes are not instantiable so I know that Laravel…
noobmaster69
  • 2,985
  • 3
  • 27
  • 44
5
votes
5 answers

Preflight OPTIONS request by AngularJS not working with Chrome?

I have developed a simple application using AngularJS hosted here. I am consuming an API I developed myself in Laravel hosted here. When I try to log into the application using Firefox, it works fine. My API accepts the pre-flight OPTIONS request…
Rohan
  • 13,308
  • 21
  • 81
  • 154
5
votes
1 answer

Laravel many to many selecting with Eloquent

I have 2 tables, users and skills, and a many to many relationship between them. Pivot table skill_user also has column 'level' - at what level this user knows this skill. in User model I have: public function skills(){ return…