Laravel 3 is the outdated version of the open-source framework for PHP web development created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax.
Questions tagged [laravel-3]
392 questions
13
votes
3 answers
Breakpoints not hit with xdebug, PhpStorm and Laravel 3 / mod_rewrite
I'm pretty desperate and running out of ideas:
I've configured xdebug and PhpStorm for a Laravel 3 project. Running the project locally on Mac OS X Apache, so PhpStorm and the web application run on the same machine. Configured a virtual host so…

Ralf
- 2,512
- 4
- 24
- 26
12
votes
2 answers
Laravel 3 Eloquent How to select column as
I'm trying to figure out how to give a column an alias using Eloquent.
So, in other words, how do I execute the following mysql query using Eloquent?
SELECT occupation AS test FROM users WHERE occupation = 'PIMP';
Thx in adv!

darksoulsong
- 13,988
- 14
- 47
- 90
12
votes
4 answers
Getting selected values from a multiple select form in Laravel
For generating a drop-down list with an item selected by default, the following is done:
echo Form::select('size', array('L' => 'Large', 'M' => 'Medium', 'S' => 'Small'), 'S');
So I generated a drop-down list that has more than one item selected by…

SUB0DH
- 5,130
- 4
- 29
- 46
12
votes
7 answers
Testing laravel controllers with JSON request body
I am trying to write a phpunit test for a Laravel controller which expects post requests with a body in JSON format.
A simplified version of the controller:
class Account_Controller extends Base_Controller
{
public $restful = true;
public…

Reidsy
- 373
- 1
- 4
- 10
11
votes
4 answers
Username as subdomain on laravel
I've set up a wildcard subdomain *.domain.com & i'm using the following .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !www\.
RewriteCond %{HTTP_HOST} (.*)\.domain\.com
RewriteRule .*…

Ivanka Todorova
- 9,964
- 16
- 66
- 103
10
votes
3 answers
Protecting all admin/ routes with auth in Laravel
I am brand new to laravel and am setting up admin panel authorization on my first application. The way I have my files setup currently setup is:
controllers/
admin/
dashboard.php
settings.php
non-admin-controller1.php
…

Yev
- 2,051
- 9
- 27
- 46
9
votes
3 answers
Binding View::composer to match all views using wildcards?
I have a navigation bar like this.
Account
- Register
- Login/li> ... I want to update this dynamically depending on Auth::check(). For example, if the user is logged in, "Account" will be changed with…

Aristona
- 8,611
- 9
- 54
- 80
9
votes
1 answer
Get Laravel 'public' path for javascript file
I'm unsure how I can get something equivalent to: path('public') to work in a Javascript file?
I basically just need the path to the public folder for displaying some images from my JS file.

dan2k3k4
- 1,388
- 2
- 23
- 48
9
votes
1 answer
Eager Loading from the model in Laravel 4
In Laravel 3, one could do the following in the model (http://laravel.com/docs/database/eloquent#eager):
class Book extends Eloquent
{
public $includes = array('author'); // this line
public function author()
{
return…

Ben
- 15,938
- 19
- 92
- 138
9
votes
2 answers
Array to String to Array conversion
I have an array that I'm storing as a string in a database to make it easier to retrieve (it's refreshed with new data every 15-30minutes via cron).
'player_list' -> 'Bob,Dave,Jane,Gordy'
'plugin_list' -> 'Plugin-A 1.4, Plugin-B 2.1, Plugin-C…

MCG
- 583
- 4
- 8
- 18
9
votes
4 answers
How to set env with laravel artisan to have two different database connections (local/remote)?
I looking for setup a multi-environment project using Laravel3 but I dont understand the command to set the environment.
I see here: http://laravel.com/docs/artisan/commands
The command is:
php artisan foo --env=local
I already used artisan and bob…

Lucas Serafim
- 3,702
- 6
- 30
- 36
8
votes
2 answers
Print the values on server side in Laravel Php
I am totally new to PHP and Laravel Framework.I want to print the variables in Laravel on server side to check what values they contains. How can I do console.log or print the variable values on the server to see what those contains in Laravel PHP.

Sajid Ahmad
- 1,124
- 4
- 18
- 40
8
votes
1 answer
Transferred Laravel app to new server - not working
I created my first Laravel (3.2) app awhile back on a VPS that I had. Now, the time has come for me to move to a dedicated server, and I need to move that app to the new server.
I used RSYNC via SSH and transferred everything over to the new server,…

nitsuj
- 780
- 1
- 11
- 27
8
votes
1 answer
PHP: try/catch fail
I'm running WAMSERVER 2.4 (32-bit) with PHP 5.4.16, this is a Laravel 3 project.
In a try block, which I'm expecting to fail, I am submitting a duplicate row for insertion against a uniqueness constraint.
Instead of handling the exception in the…

mOrloff
- 2,547
- 4
- 29
- 48
8
votes
5 answers
How can I allow WYSIWYG editors and disable XSS attacks using Laravel?
I have a enterprise level application where logged in users are authorized to post articles to page using a WYSIWYG editor. (You can consider this application as a website builder.)
Everything works fine, but the problems are;
WYSIWYG editor posts…

Aristona
- 8,611
- 9
- 54
- 80