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
95
votes
11 answers

Laravel validation attributes "nice names"

I'm trying to use the validation attributes in "language > {language} > validation.php", to replace the :attribute name (input name) for a proper to read name (example: first_name > First name) . It seems very simple to use, but the validator…
Hak
  • 1,265
  • 2
  • 18
  • 21
94
votes
9 answers

How to set every row to the same value with Laravel's Eloquent/Fluent?

I need to update all of the rows in a database so that a particular field in all of them is equal to a single value. Here's an example. Let's say my database table is like…
Pete
  • 7,289
  • 10
  • 39
  • 63
90
votes
19 answers

My Routes are Returning a 404, How can I Fix Them?

I've just started learning the Laravel framework and I'm having an issue with routing. The only route that's working is the default home route that's attached to Laravel out of the box. I'm using WAMP on Windows and it uses PHP 5.4.3, and Apache…
JasonMortonNZ
  • 3,752
  • 8
  • 34
  • 56
85
votes
12 answers

Laravel - Pass more than one variable to view

I have this site and one of its pages creates a simple list of people from the database. I need to add one specific person to a variable I can access. How do I modify the return $view->with('persons', $persons); line to also pass the $ms variable to…
pjmil
  • 2,087
  • 8
  • 25
  • 41
79
votes
10 answers

Laravel - Using (:any?) wildcard for ALL routes?

I am having a bit of trouble with the routing. I'm working on a CMS, and I need two primary routes. /admin and /(:any). The admin controller is used for the route /admin, and the view controller should be used for anything else than /admin. From the…
qwerty
  • 5,166
  • 17
  • 56
  • 77
42
votes
4 answers

Unable to Get Eloquent to Automatically Create Joins

Apologies in advance if the answer to my question is obvious. I have done my due diligence in researching this topic before I posted it here. Most of my framework experience comes from using CodeIgniter, so I've never had hands-on experience using…
Graham Kennedy
  • 736
  • 6
  • 18
32
votes
14 answers

Convert laravel object to array

Laravel output: Array ( [0] = stdClass Object ( [ID] = 5 ) [1] = stdClass Object ( [ID] = 4 ) ) I want to convert this into normal array. Just want to remove that stdClass Object. I also tried using…
Your Friend
  • 1,119
  • 3
  • 12
  • 27
32
votes
3 answers

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 [password] => admin123 [email] =>…
Ramesh
  • 1,829
  • 2
  • 25
  • 30
28
votes
2 answers

Templating in Laravel

I'm trying to get my default template working with Laravel. I'm coming from Codeigniter and Phil Sturgeon's template system so I'm trying to do it in a similar way. Can anyone help me with what I'm missing/doing wrong? Thanks! //default.blade.php…
coryj
  • 1,255
  • 3
  • 14
  • 29
26
votes
4 answers

Where can I get a complete list of Laravel events (fired by the core libraries)?

I want to know what events are fired by Laravel core libraries. I want to get the complete list, such as laravel.query and laravel.done. There are four events listed at the official docs, but I think Laravel has more events than these four!
Omid Kamangar
  • 5,768
  • 9
  • 40
  • 69
24
votes
3 answers

Check for Session timeout in Laravel

I was just wondering if anyone knew how to check for session timeout in Laravel. You can check whether the session has a specific item: if (Session::has('name')) { $name = Session::get('name'); } But you can't check whether the session has…
mattl
  • 2,082
  • 3
  • 17
  • 24
23
votes
4 answers

How to use SQL Server connection in Laravel?

I got a working project made in Laravel 3 that I have to switch to MsSQL Server (not my call though, sniff...) and I don't understand the Laravel configuration on this database type... I changed the default inside database.php to this 'default' =>…
ghiscoding
  • 12,308
  • 6
  • 69
  • 112
16
votes
16 answers

increment row number with laravel pagination

How to make increment row number with laravel pagination ? When i use pagination and i go to page 2 and above it will back to beginning. for example i will paginate(3) No Name …
user2194246
  • 193
  • 1
  • 1
  • 6
15
votes
2 answers

Laravel query builder with AND in query

I want to add an "AND" clause to the end of a query builder, the code looks like this: $orderers = DB::table('address')->where(function($query) use ($term) { $query->where('id', 'LIKE', '%' . $term . '%') …
Khanh Tran
  • 1,776
  • 5
  • 25
  • 48
13
votes
1 answer

Using Distinct in Laravel Fluent

I have this join: Return DB::table('volunteer') ->join('volunteer_volunteer_category', 'volunteer_volunteer_category.volunteer_id', '=', 'volunteer.id') ->select(array('*','volunteer.id AS link_id')) …
Glenn Williams
  • 131
  • 1
  • 1
  • 3
1
2 3
26 27