Laravel is an open-source PHP web development framework created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax.
1
vote
1answer
59 views
CRUD implementation using Laravel 4
I just started using Laravel 4. I read some tutorials on how to implement CRUD in Laravel, and I was able to develop a portion of it. What I am going to show you is more on Controller and Eloquent ...
0
votes
0answers
45 views
Laravel Pagination: a new one adapted from an old Dreamweaver extension
I'm new to Laravel and I'm trying to port the most important old-procedural-code snippets and libraries I collect in some years
I missed a nice Pagination I had in an old Dreamweaver extension and I ...
3
votes
2answers
49 views
Effective usage of multiple joins in Eloquent dependent on variable
I have an Eloquent model that has multiple types of joins that is used to filter out different request to grab the data of movies e.g.: Actors, ...
3
votes
1answer
68 views
Returning JSON depending on the route_id
I have a controller that has a purpose of returning json depending on the route_id being passed from the route (Using laravel). There's a point in my code where I ...
4
votes
3answers
358 views
Controller method - Ajax request
I'm quite new to Laravel, and I'm not sure what am I doing is the best practice.
I'd like to return JSON if the request is Ajax, or return a view otherwise. This is the way I made it, and it works ...
3
votes
1answer
90 views
Clean up / refactor this store() method
I'm new to Laravel and trying to figure out how I can reduce/refactor this store() call in my SessionController.
Basically, the ...
0
votes
1answer
1k views
Optimizing Laravel Eloquent multiple joins
The following is working and readable SQL for Eloquent that I have created. The downside is that it looks more like a 1:1 with SQL and I don't think I'm using the full potential of Eloquent. I thought ...
5
votes
1answer
113 views
Controller for handling user registration
I spent a lot of time doing Go Horse Extreme programming, but now I want to be a better person.
How can I make this method smaller, better, more OOP?
...
4
votes
2answers
924 views
Laravel - Repository and Entity patterns
I've spent quite a bit of time studying the repository and entity patterns and this is what I came up with. I would appreciate it if you could post suggestions and critique.
...
2
votes
1answer
294 views
Laravel - lots of dependency injection
I have the following UserServiceProvider and I'm wondering whether so much dependency injection is overkill:
...
2
votes
0answers
234 views
Social user login
This is my first Laravel package. It uses hybrid Auth package to authenticate users using their social network accounts. It can retrieve information to store in a local database.
Its purpose is to ...
3
votes
1answer
376 views
Simple application to experience encapsulation
Looking at the code, is this a proper example of encapsulation?
additionalComputer.php (class)
...
5
votes
1answer
1k views
Laravel model and controller interaction
I want to know if I'm going about creating and calling two functions from my model to my controller in the simplest and cleanest way.
Model:
...
3
votes
1answer
525 views
Laravel 4 clean code review of users controller and model, trying to maintain MVC structure
I'd like you to review my attempt at creating an authorization class and let me know if there is re-factoring to be done and/or how I can make the code cleaner and abide by the MVC structure.
...
2
votes
1answer
165 views
How do I reduce the if..else soup in this Controller function?
The processing is the same, but the response type differs based on whether it's an AJAX request or not.
One way I can think of is to store all the response calls inside closure functions, and return ...
1
vote
1answer
724 views
Multi-page form attempt
I have just started playing around with L4 and would like to get some feedback on how I implemented a multi-page form
Here are my routes:
...