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 - routing to a folder inside "views"

I'm still new to laravel and learning my way through. Normally, for example, if I want to access the file "login.blade.php" (located in "views" folder), the route would normally be: Route::get('/login', array('as' => 'login', 'uses' =>…
Ethan McKee
  • 215
  • 2
  • 3
  • 7
5
votes
2 answers

Returning a correct JSON response

I'm using Laravel 4 for a project I'm working on. It relies heavily on AJAX for a lot of its functionality. In the jQuery I use to upload files (fileupload), I have the following success and fail function: done: function (e, data) { // Show…
BigJobbies
  • 499
  • 8
  • 20
5
votes
1 answer

Dependency injection on custom classes stuck in indefinite loop in L4.2?

I've been changing my Controllers and helper classes to use dependency injection, and it seems I've got my helper classes stuck in an infinite loop. Below is my custom ServiceProvider and the two sample helper classes. As you can see, they inject…
Luke Shaheen
  • 4,262
  • 12
  • 52
  • 82
5
votes
1 answer

Call to undefined method Illuminate\\Database\\Schema\\Blueprint::increments()

I'm new at laravel 4 and in my first project when I try to migrate this I got this error : Migration table created successfully. {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to undefiend…
ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
5
votes
1 answer

Laravel form binding with one to one relationships

I have an Account model that has a polymorphic relation to an Address model. This is set up as a one-to-one releationship set up like so: Account: public function address() { return $this->morphOne('Address', 'hasAddress', 'add_hasaddress_type',…
Troncoso
  • 2,343
  • 3
  • 33
  • 52
5
votes
2 answers

ssh_exchange_identification read connection reset by peer - Homestead Laravel

I'm trying to connect to Homestead using the vagrant ssh command but I'm getting the below error message. I'm using Windows 7. How do I fix this issue? ssh_exchange_identification read connection reset by peer Bringing machine 'default' up with…
bobhope
  • 113
  • 1
  • 3
  • 10
5
votes
1 answer

Laravel 5: put, patch and delete requests without using Form builder

Since in Laravel 5 the form builder class is absent (you can add it, I know), how can I make put, patch and delete requests to match those routes without using any form builder class, just plain Laravel?
Luuk Van Dongen
  • 2,391
  • 6
  • 26
  • 40
5
votes
2 answers

How do I make laravel Password::Reset use a user id rather than email?

I am attempting to reset a user's password in Laravel, but the Password::reset method is looking for an email column in the password_tokens table, rather than an id column. $credentials = ['password' => Input::get('password'), 'id' =>…
Superfly
  • 571
  • 3
  • 13
5
votes
1 answer

Merging results from belongsToMany and belongsTo relationships in Eloquent

In my Image model I have two relationships with my Article model, one many-to-many and one one-to-many: public function articlesAlbums() { return $this->belongsToMany('Article', 'article_image', 'image_id',…
Thomas Jensen
  • 2,138
  • 2
  • 25
  • 48
5
votes
2 answers

Laravel Mass Assignment for Admins

I have an app with a Users table with columns: id|name|email|is_admin. I want admins to be able to set other users as admins. In models/User.php I prevent mass-assignment with: protected $fillable = ['name', 'email']; Laravel 4 Role Based Mass…
Justin
  • 26,443
  • 16
  • 111
  • 128
5
votes
2 answers

Method Illuminate\\View\\View::__toString() must not throw an exception in unix

I am using laravel 4.2 die(View::make('amendments.changesPopUp', $this->data)); This is the code that I am using to get the view for an ajax call. This is working for my local machine running on windows but this is not working for server( unix ).…
developernaren
  • 514
  • 5
  • 20
5
votes
1 answer

Laravel Eloquent - sync() on a Morph relationship

It seems like there is no sync() function for morph tables on Laravel. I have two tables avails and questions. questions is a morphMany table. I want to use the sync command, and this is what I…
Kousha
  • 32,871
  • 51
  • 172
  • 296
5
votes
3 answers

Laravel Multiple Unions

I'm having an issue adding a query with multiple Unions the "laravel way". The I am trying to accomplish a query equivalent to the one generated by the following: $ipsql = ""; for ($n = 1; $n < $total_networks; $n++) { $ipsql .= "(SELECT * FROM…
Tom McDonald
  • 269
  • 1
  • 3
  • 11
5
votes
3 answers

Laravel 4: Redirect a post request to different controller method

I have a controller like below, MyController: public function methodA() { return Input::get('n')*10; } public function methodB() { return Input::get('n')*20; } I want to call the a method inside MyController according to POST value. …
palatok
  • 1,022
  • 5
  • 20
  • 30
5
votes
1 answer

Where does Laravel store configuration for memcached session driver?

The Laravel docs specify that you can enable memcached as a session handler in app/config/session.php; however, it does not specify where memcached itself is configured (such as the servers to use). I see that you can configure memcached in…
Scott Buchanan
  • 1,163
  • 1
  • 11
  • 28