Skip to content

Tag: laravel

Laravel templates/controllers not updating on save

I’m running a Laravel 4 for a simple app on OS X. Basically, changes to controllers and templates don’t take effect for a long time after I save changes to those files. For example, I add a word to /app/views/index.blade.php, and don’t see any change when constantly refreshing my browser for…

Escape raw SQL queries in Laravel 4

How does one go about escaping parameters passed to a raw query in Laravel 4? I expected something like DB::escape() (which rings a bell from Laravel 3) and also attempted DB::quote() (which I thought could be available through the PDO object) We can’t use the select method with placeholders as the abov…

Laravel or where

Currently I am working on a project in Laravel but I am stuck.I want to create a SQL statement like this: Now I have this code: But that generates: How can I get the correct “or” order? Answer Check out the Logical Grouping section in the docs: https://laravel.com/docs/master/queries#logical-group…

Calling other function in the same controller?

I’ve this controller, and the function read($q) return error Call to undefined function sendRequest() I’m assuming it’s because I’m referencing the function in the wrong manner, but I can’t find any explanations for how to do it. Answer Try: Since PHP is not a pure object-oriente…