Questions tagged [laravel-3]

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.

392 questions
3
votes
0 answers

Passing serialized form data to my (Laravel) controller

I have a form that asks the user to make 10 game picks and then sort the picks based on confidence. I'm using jQuery's sortable function and then populating a hidden form element (order-array) with a serialized string on each update to the order. …
Jaystew
  • 299
  • 1
  • 5
  • 9
3
votes
1 answer

How to list out all items in a nested table in Laravel

I am using Laravel's Eloquent ORM and I'm having trouble eager loading items for display. Here is the scenario: Users follow Blogs Blogs have Posts I have a database table named Relationships, this table is used to store the User ID and the Blog…
Karl
  • 595
  • 1
  • 10
  • 31
3
votes
0 answers

create temporary table using laravel schema builder

I was wondering if there's any way to create temporary table using the laravel's schema builder. I'm using laravel 3.2 thanks in advance.
Foysal Ahamed
  • 282
  • 1
  • 7
  • 17
3
votes
2 answers

How to eager load in Laravel, while finding a specific entry

I want to eagerly load a specific user, with their User Profile. My table and class is called users and User respectively. My Profiles table and class is user_profiles and UserProfile. This is what I'm trying but it doesn't seem to work return…
WebDevDude
  • 829
  • 1
  • 8
  • 14
3
votes
1 answer

Eloquent query builder - hasOne error

This is driving me nuts. I have 2 tables; explanations and transactions. In the models folder I have transaction.php and explanation.php. transactions.php:
Luke Snowden
  • 4,056
  • 2
  • 37
  • 70
3
votes
1 answer

Laravel 3: Run migrations on production server / in .php file

I have been working with Laravel 3 on my local server. I have been using terminal and Artisan to perform my migrations. I want to install my site on my production server, but I want to create a sort of 'install/migration' script that will perform…
GWed
  • 15,167
  • 5
  • 62
  • 99
3
votes
1 answer

Laravel custom validation

--- Custom validation class (application/libraries/validator.php) --- class Validator extends Laravel\Validator { public function validate_passwdU($attribute, $value, $parameters){ $r_uppercase = '/[A-Z]/'; //Uppercase …
Sophy SEM
  • 223
  • 5
  • 19
3
votes
2 answers

Laravel: how can I loop through the fields and relations of an ORM

In Laravel if I create an ORM for a table, lets say pages Is there a way to list/loop through all the tables fields and their values (from the database), and on top of that is there a way to list/loop through all the relationships. Is there a way to…
jaget
  • 2,149
  • 6
  • 21
  • 29
3
votes
1 answer

Laravel (Eloquent) Not Updating Database

Got a big problem that's confusing as hell. I'm using Laravel (3.2.5 and now 3.2.7) and I'm using the Eloquent ORM for updating a database (PostgreSQL). Here's what I'm doing: I have a db full of data I'm pulling info from an external API to update…
antjanus
  • 987
  • 3
  • 15
  • 30
2
votes
1 answer

Upload video with Laravel

I have a problem with my upload in laravel. My view : {{ Form::open(array('url'=>'administration/video/create','method' => 'post','files'=>true)) }}

{{ Form::label('Titlu:') }} {{…

Harea Costea
  • 275
  • 5
  • 19
2
votes
4 answers

Laravel get TimeZone not working

Iam trying to convert UTC timezone to Singapore Time echo $Date->format('Y-m-d H:i:s'); echo '
'; echo with(new Carbon\Carbon($Date->format('Y-m-d H:i:s')))->tz('Asia/Singapore')->format('Y-m-d H:i:s'); exit; it works fine in…
Your Friend
  • 1,119
  • 3
  • 12
  • 27
2
votes
3 answers

Can you use query builder to build a query with a dynamic WHERE clause at runtime in laravel3?

I know in Laravel 4 you can create a dynamic WHERE clause at runtime as from the following question: Can you use query builder to build a query with a dynamic WHERE clause at runtime in laravel? But can you do the same in laravel 3? If not, is…
WildBill
  • 9,143
  • 15
  • 63
  • 87
2
votes
1 answer

PHP: Instantiating a class from a variable oddly fails

I'm trying to instantiate a class (a Laravel3 Eloquent model) by a variable, and I'm getting an error saying that the class is not found. When I hardcode the class name, though, it works just fine. (FYI, in the code below $contact_type is expected…
mOrloff
  • 2,547
  • 4
  • 29
  • 48
2
votes
3 answers

How to run 'SELECT FOR UPDATE' in Laravel 3 / MySQL

I am trying to execute SELECT ... FOR UPDATE query using Laravel 3: SELECT * from projects where id = 1 FOR UPDATE; UPDATE projects SET money = money + 10 where id = 1; I have tried several things for several hours…
Jonathan
  • 8,676
  • 20
  • 71
  • 101
2
votes
2 answers

Laravel 3 : Looking for explanation how to use the model

I'm new at MVC and my first framework is Laravel (3 for now). I've started coding exclusively in the routes, and I moved to the controller. I'm however doing all of my database operations in the controller. I do not understand how to use the…
veksen
  • 6,863
  • 5
  • 20
  • 33