I am trying to upload a file, I am using laravel 4 and deploy on google app engine. Locally file upload works, but then when deploy with google app engine it doesn’t. Here is my code: view: controller and it displays an array with file attr. But when deployed with google app engine this code returns NULL. After readin google
Tag: laravel
PHP Laravel – Allow users to use a custom domain name
I’ve looked through pretty much every single page I could find on the topic, but I’m still bit confused. I have a PHP Laravel 4.0 web site, which is at http://www.mywebsite.com When a user signs up, each user gets their own page http://user1.mywebsite.com I have set the above via wildcard sub domain on my VPS DNS manager (Linode). And in
laravel foreach loop in controller
i have a problem about looping data in controller (laravel 4). my code is like this: when i want to use foreach to loop for $product result with code like this: the result is returning error Undefined property: IlluminateDatabaseEloquentCollection::$sku so, i try to improvise a little with this code: the code returning error like this: Invalid argument supplied for foreach()
Laravel Controller doesn’t exist, even though it clearly exists
The error I’m getting is that the controller doesn’t exist even though I know it does, here’s the code. Route.php Route::get(‘mdpay/template’, array(“uses” => “templateController@index”)); …
Laravel Eloquent – Attach vs Sync
What is the difference between attach() and sync() in Laravel 4’s Eloquent ORM? I’ve tried to look around but couldn’t find anything! Answer attach(): Insert related models when working with many-to-many relations No array parameter is expected Example: sync(): Similar to the attach() method, the sync() method is used to attach related models. However, the main differences are: sync() accepts
How to specify Books and Authors relationship in Eloquent insertion?
I was figuring out how to insert a hasMany entry using Laravel 4 Author.php module Book.php Module My controller I’m getting one null record on authors table which pointed to the book and other 3 record that I inserted here without any pointing to the book. Answer First off I believe this is wrong schema, since probably one author could
How to debug Laravel framework?
I’m a newbie PHP programmer now casting an eye at frameworks, and among them Laravel sounds appealing to me as a beginner (somehow unfortunately because I’ve already invested in literature on Zend 2). …
Laravel Check If Related Model Exists
I have an Eloquent model which has a related model: When I create the model, it does not necessarily have a related model. When I update it, I might add an option, or not. So I need to check if the related model exists, to either update it, or create it, respectively: Where <related_model_exists> is the code I am looking
How to reload/refresh model from database in Laravel?
In some of my tests, I have a user model I have created and I run some methods that need to save certain attributes. In rails, I would typically call something like user.reload which would repopulate the attributes from the database. Is there a way in laravel to do that? I read through the api and couldn’t find a method
Laravel: Validation unique on update
I know this question has been asked many times before but no one explains how to get the id when you’re validating in the model. My validation rule is in the model so how do I pass the ID of the record to the validation rule. Here is my models/User models/BaseModel Answer One simple solution. In your Model In your