212,680 questions
0
votes
3
answers
8k
views
Laravel validation on checkbox which named as array
I've some areas in my form something like:
<ul>
<li>
<input type="checkbox" name="post_categories[]" value="16">English First Main Category<br>
<ul>
<li><input ...
3
votes
2
answers
5k
views
How to mix raw SQL and non-raw with Laravel's fluent query builder
I'm sure it's very simple but I couldn't find any examples.
I am using fluent in my Laravel application to log my users' logins and so I have created my own auth driver, however I am having a problem ...
2
votes
1
answer
489
views
PHP dynamic link list breaks ajax
I have this list of things generated from an array, where the array value maps to the array key, which maps to a query in the database. Now the problem I'm facing is that when this list is included in ...
1
vote
3
answers
518
views
How to know where var_dump function is used? [closed]
I'm trying out Laravel 4. When using the ORM to create a new user account, this is echoed to the page:
array(1) {
[0]=>
object(stdClass)#103 (1) {
["id"]=>
int(98)
}
...
0
votes
1
answer
696
views
How to add relationships in Laravel?
I tried following the documentation found at http://net.tutsplus.com/tutorials/php/build-web-apps-from-scratch-with-laravel-the-eloquent-orm/ and http://laravel.com/docs/database/eloquent but it ...
2
votes
2
answers
458
views
MySQL Access violation in Laravel that works in phpmyadmin
I've just started using Laravel Framework and found a nice little guide for hierarchical-data (through this site) that I have working quite well.
The only problem I've come across is running the ...
1
vote
2
answers
3k
views
Laravel shared hosting - Directive 'safe_mode' is deprecated in PHP 5.3 and greater
I made a website with laravel for one of my clients, and they are using a shared hosting.
And i installed laravel to its home folder, so public folder became the public_html folder in host, and i ...
4
votes
1
answer
4k
views
Eloquent how to search in relation's values
I have the following tables with the following fields:
person: id, lastname, firstname
phoneboookentry: id, name
I have the following two models:
class Person extends Eloquent
{
public static ...
0
votes
2
answers
1k
views
Is there a Laravel Sample App with authentication(ion or similar)+bootstrap+mongo support? [closed]
I am exploring the possibility of using Laravel in our startup. Looking to explore it through an app that provides above all to see how that behaves and how it compares to codeigniter framework.
0
votes
3
answers
787
views
Templating login view in Laravel
So, I was wondering which is the best way include a single view (views/login.blade.php) into a layout loader, so I won't have to repeat all the code again.
This is my route that loads the login view:
...
2
votes
1
answer
290
views
"column" IS NOT NULL in query does not throw error when column does not exist
In my PHP unit tests, I am using an SQLite in-memory database, which contains the following table:
CREATE TABLE "battlegroup_request" (
"id" INTEGER NULL PRIMARY KEY AUTOINCREMENT,
"battlegroupID"...
44
votes
4
answers
36k
views
Simple application built with laravel? [closed]
I am looking at getting into Laravel, it looks like an awesome framework, but it seems to be missing one vital piece of its documentation... A "Getting Started" tutorial.
A simple blog ...
2
votes
1
answer
2k
views
laravel blade @yield inside js
Hi im trying to use blade to create a dynamic tracking code for my website.
this is what i have so far i tried yielding straight to the piwikTracker var but got all sorts of errors passing it as a ...
3
votes
2
answers
2k
views
Running Basic Laravel Task in Routes.php - "Sorry, can't find that task."
I'm trying to setup a Laravel task to eventually be called as a cron job using the artisan interface.
In trying to get a simple task working, I keep getting the error that Laravel can't find that ...
0
votes
3
answers
1k
views
Laravel authorization 404
Been using laravel (current stable version) for 2 days now, and after reading the documentation... played a bit with the templating systems and some other stuff.
Now after installing Authority bundle ...
385
votes
17
answers
445k
views
Laravel - Eloquent or Fluent random row
How can I select a random row using Eloquent or Fluent in Laravel framework?
I know that by using SQL, you can do order by RAND(). However, I would like to get the random row without doing a count on ...
1
vote
2
answers
4k
views
Is there is an easy way to print out form input In Laravel
I have a basic form where i would like to extract the user input and then display the concatenated inputs from the form
echo Form::open('url_encoder','GET');
echo Form::token();
echo Form::text('...
46
votes
10
answers
33k
views
Environment driven database settings in Laravel?
I am moving over the the Laravel framework, but I am having trouble with the database settings,
Specifically, I have my environments setup, and they are working fine for the application.php config ...
23
votes
3
answers
23k
views
Dynamic urls in laravel?
I am looking at switching to laravel for my next project.
My next project is probably going to be a small site with a few static pages, a blog and a projects manager and will be using controllers not ...
0
votes
1
answer
3k
views
Session variables lost in Popup window?
I have a bookmarklet that injects a button on a foreign webpage. When the button is clicked, a popup containing a page from my website appears.
I am using a PHP framework called Laravel, tested using ...
2
votes
1
answer
1k
views
Laravel nested controller with restful
In my Laravel Project, I have following folder structures
application/controllers/products.php
application/controllers/products/categories.php
In my products.php
class Products_Controller extends ...
3
votes
2
answers
2k
views
Is mongoDB suitable for a blogging platform like blogger? [closed]
Im going to try to develop a web application like blogger(blogspot). I'm going to have users, every user will have a blog, the user can post in his blog, the post will have tags. Other users should be ...
3
votes
1
answer
2k
views
Laravel 4 Injecting an Eloquent Model in a controller
I am new to this concept of DI, and IoC so i might be doing this completely wrong but i am trying to inject the Model that matches a controller into that controllers constructor (UserModel -> ...
19
votes
4
answers
12k
views
Alter column length in Schema builder?
I have two fields i need to increment the character limit on. I're read through the documentation and to my surprise i found no option for it. Is it possible to do? If not, how should i go about ...
1
vote
1
answer
174
views
Filter tags by tags and count
My mysql structure is as follows:
+----+-------------------------+-------------+-----------+--------------+
| id | title/text/moretext/img | language_id | course_id | country_code |
+----+------------...
6
votes
3
answers
7k
views
PHP flush() doesn't work with laravel?
I'm using Laravel and I need to output data as it happens. When I attempt to load the page outside Laravel, it works just fine. If I use this inside Laravel, it doesn't flush, it waits until the end ...
3
votes
1
answer
5k
views
Laravel custom validation
--- Custom validation class (application/libraries/validator.php) ---
class Validator extends Laravel\Validator {
public function validate_passwdU($attribute, $value, $parameters){
$...
0
votes
1
answer
885
views
Laravel one-to-many relationship returns null
So here's what i have set up. I have two tables; users and todos. Every user can have multiple "todos".
Here's what the tables look like:
Users:
Todos:
And the models:
class User extends Eloquent
{...
8
votes
2
answers
3k
views
Laravel: how to eager load a model that's two steps down?
Let's say I have users which have many computers which belong to a certain computer_type (users->computers->computer_type).
I know that I can load both users and their computers with: User::with("...
1
vote
1
answer
5k
views
Routing URLs with language in Laravel
I want to add a localization information to my routes.
Currently my route definitions are:
Route::controller('browse');
Route::controller('search');
Route::controller('support');
...
4
votes
2
answers
7k
views
laravel session returning null inspite of setting it
Just a simple function in native php
protected function some_function(){
session_start();
if(!isset($_SESSION['a']))
{
$_SESSION['a'] = 'some value';
return true;
} ...
16
votes
3
answers
4k
views
How to Deploy CodeIgniter/Laravel Apps
I need to know which are my options when deploying codeigniter/laravel apps.
I develop locally all the time at my home and when i go to work i need some quick way to push all the changes to the ...
0
votes
1
answer
994
views
How do I configure Laravel for Elastic Beanstalk?
I've got the instance going and everything but my config doesn't work and I don't what to try to make it work.
All I get are 503 errors and no explanation.
Production mode config
return array(
...
2
votes
1
answer
3k
views
Laravel Model with Multi Column Primary Key
So I have a simple table in my application which stores many to many relationship between users and orders. As such, this table has a 2 column primary key (userid, orderid) to store values.
In ...
0
votes
1
answer
2k
views
Laravel: How to I pass a Blade template to the client side via JSON?
I wish to pass a JSON object that includes some HTML to my client-side application. I'm using Laravel 3.2.12 and I'm new to it.I know the problem is in my View::make directive. Which is the correct ...
4
votes
4
answers
11k
views
JSONP with Laravel [duplicate]
Browser sends JSONP requets to Laravel, Laravel returns the results to browser. In the brower console, I get the warning:
Resource interpreted as Script but transferred with MIME type text/html:
I ...
34
votes
3
answers
66k
views
How to retrieve a result set from a raw query as an array instead of an object in Laravel 3
By default, Laravel's raw query methods return results as arrays of stdClass objects:
Array
(
[0] => stdClass Object
(
[id] => 1
[username] => admin
...
7
votes
9
answers
29k
views
Laravel auth check for all pages
I have created the Authentication, and its working perfectly. But there is some problem in checking the inner pages. For example,
Route::get('/', array('before' => 'auth' , 'do'=> function(){
...
0
votes
1
answer
2k
views
Laravel - "Other" place holder not accepting friendly names in validation message
In Laravel,
I am using custom validation in my project to check whether mininum area having smaller value than maximum area. Just created the validation in Validator library
public function ...
6
votes
2
answers
1k
views
How to understand if an e-mail address is an education e-mail address or not?
I want only college students to be able to sign up my website, but I couldn't figure out how to control that. I also want .edu.fr, edu.tr or other .edu extensions to be able to join my website not ...
1
vote
2
answers
199
views
Admin Routes (Nested Controllers or Bundles)
I'm studying the Laravel 3, 1 week ago, but didn't understand everything about the routes.
My main question is: how to create administrative routes?
In the video lessons from Jeffrey Way (Tuts ...
1
vote
3
answers
4k
views
Laravel - Handling 500 error message
In laravel I want to change the error message and log it for 404 and 500 event. i tried for 404 event by event listener in routes.php,
Event::listen('404', function()
{
Log::write('404', 'Could not ...
28
votes
6
answers
36k
views
Laravel - When to use ->get()
I'm confused as to when ->get() in Laravel...
E.G. DB::table('users')->find(1) doesn't need ->get() to retrieve the results, neither does User::find(1)
The laravel docs say "...execute the ...
0
votes
1
answer
403
views
Laravel Update Record - Is this the most efficient with 2 MySQL calls?
So as a follow up to an earlier post, I'm curious if this is the most efficient way to update a record based on POST data.
Routes.php
//COLLECT POST DATA IN $thisOrder ARRAY
//DETERMINE THAT $...
22
votes
3
answers
48k
views
Laravel Update Syntax - Updating Record with Array
I'm having trouble doing a basic record update via POST in Laravel.
I have captured all the post data in an array, and if the existing Order# is 0, then I create a new record (works fine). Otherwise ...
-1
votes
1
answer
1k
views
Setting cookie by PHP and reading using JavaScript
I use the Laravel PHP framework and set a cookie using Cookie::put(..),
Code to set cookie using Laravel PHP,
Cookie::put('id', $id , 0, '/');
when I looked into it I found cookie is being set to a ...
1
vote
2
answers
2k
views
How to validate multi-row forms in laravel
Is it possible to validate multirow forms in laravel. I would like to validate a form which looks like this:
<input name="address[]" class="addr"/>
<input name="address[]" class="addr"/>
...
6
votes
5
answers
47k
views
Call Controller Function from Laravel Routes.php
I have a function in my Orders_Controller in Laravel called getOrders($user). It calls a raw DB query and builds a JSON array to return.
I cannot figure out how to call this function from within my ...
6
votes
1
answer
8k
views
Using route filters in Laravel
I'm trying to use route filters in laravel to check whether a specific user has an access to a page:
Route::filter('check_roles', function()
{
$current_url = URI::current();
$access = 0;
$...
-2
votes
1
answer
1k
views
How to clear the Laravel Application Key via Terminal
I'm creating a application. I want to clear the Laravel Application key via terminal. Not manually.
Is there any way to clear via artisan. I can only generate via following command
php artisan key:...