Laravel is an open-source PHP web development framework created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax.

learn more… | top users | synonyms

-1
votes
0answers
12 views

VueJS Laravel authentication and login for SPA [on hold]

I have developed Single Page web application using VueJS and Laravel 5.3. I have stored my configurations in a JS file (Client side) ...
1
vote
1answer
20 views

Laravel makeHidden (how to use)

I am using Laravel 5.3, and currently working on models. I have the following code: ...
3
votes
1answer
30 views

Django BaseController

A working example of mine, trying to streamlining my Django views, with absolute inspiration from Laravel: ...
3
votes
1answer
66 views

Check if relations exists for a parent node before deleting it so that we don't have any orphan child node

Here I am trying to delete a parent node but only if it doesn't have any child node. Please review this code. PostController.php ...
1
vote
0answers
26 views

Laravel 5.3 model for mapping pages to multilingual translations

I have a Many To Many Polymorphic Relation like this: ...
0
votes
0answers
28 views

Pagination with ElasticSearch results

Technologies being used: PHP 5.6 Laravel Framework 5.3 (with Blade templating) ElasticSearch 2.4.1 Bootstrap (for CSS pagination classes) ...
3
votes
1answer
76 views

Populating a form with filtered hierarchical place names

My server performs a query to get all country data with Eloquent relationships: ...
0
votes
0answers
42 views

Handling routing with jQuery + Laravel

Basically, it's a matter of code organization, trying to delegate as most responsibility as possible to the server and keeping JavaScript use to a minimum, mostly as "glue" code between the view and ...
1
vote
0answers
91 views

Extend the Laravel Eloquent model in order to easier implement CRUD REST for my routes

By extending the Model and using this inside my routefiles, I can easily call these functions inside the corresponding HTTP ...
3
votes
3answers
71 views

Device limitation rule for user

I've created a simple application for mobile users, they can login using provided API but must have limitation on the devices, so the requirement is simple : User cannot login using more than 2 ...
1
vote
3answers
80 views

External variable in callback for chunk()

I am trying to implement search in Laravel. I want to search on models. Since there can be many records in the database, I am trying the chunk function. ...
0
votes
0answers
24 views

Maintainability with lots of lookups, checks and inserts

I have the following method in a Controller in Laravel 5.3. The method is supposed to be in two other controllers and all three Controller methods will receive the needed arguments in different ways. ...
0
votes
2answers
100 views

Laravel Wordpress REST API Controller

For a Laravel project I needed to show latest three blog posts on the homepage. The blog was made with Wordpress and after some research I found a cool plugin called REST API that allows to get a json ...
3
votes
0answers
90 views

Laravel Docker-Compose

I've created a repo for some Docker containers that work together with docker-compose to make a very easy and quick installation for Laravel including nginx, mariadb, and redis. Laravel is known for ...
8
votes
1answer
115 views

Document Merger using PhpDocX

I'm developing a document merger that utilizes an FTP site containing hundreds of documents. FTP Connection Function ...
0
votes
1answer
76 views

Repository code in Laravel

I am practicing to code in the right way and make it testable. Please review this code and tell me anything bad practices of it. Entity: ...
2
votes
1answer
104 views

Laravel generate category list from product results

I have product results with some filter, and the one is category. I'll get the category list from product results. the model category and products is one to many relationship. This is the search ...
1
vote
1answer
84 views

Laravel controller to update appointment requests

My question/refactor is similar to what is found here: Laravel controller for form validation skinny However, I feel that the answer is for 5.0 and not 5.2. This question does not pertain only to one ...
1
vote
1answer
39 views

Phishing Project - Refactor Using Models

After receiving some good feedback on the previous question, I've refactored my database and have begun to refactor the associated code. As a result of implementing models for all tables in the ...
2
votes
1answer
52 views

Phishing Project Refactoring to Use a User Object

Continuing on my quest to make sure that my application is developed strong, securely, and efficiently, I've updated my code as suggested in the previous question. To start, I've implemented a ...
0
votes
0answers
26 views

Decouple resource that only lists items owned by logged user

Both methods works just fine, but I would like people's opinion on whether I'm facing this the wrong way. JWTAuth returns an ...
0
votes
0answers
35 views

Moving the HTTP and Request to controllers and Routes

I am new to Laravel framework and I made a project application which is working fine but someone said You should avoid accessing the Request object in your views. here is the full application ...
1
vote
1answer
58 views

Phishing Project UserIterator Implementation

As I stated in an answer comment on my previous question, the UserIterator has a much larger footprint than I think most people realize. This question is here to further explain the project, the ...
4
votes
0answers
68 views

Let users create custom blade templates

Problem: I need to let my web-app users create their own blade layouts. The content shall change based on what is in the database, hence their layouts should become dynamic in nature. With only the ...
4
votes
2answers
71 views

Phishing Project Sending Email with Configuration Classes

As suggested by @MikeBrant in the previous question, I've added in two configuration classes to simplify and more broadly organize the objects required to send my mail messages. This also removes the ...
4
votes
2answers
213 views

Phishing Project Sending Email Reworked

@Pimgd gave some good feedback on the previous post. I've made the changes that I think best suit my application and am looking to see what people think of this implementation. PhishingController <...
2
votes
1answer
69 views

Phishing Project Sending Email Assessment

I've gotten a lot of feedback about my tracking system already. So now I'm changing gears and looking at my email generation system. I have a class called Email which manages the sending of emails, ...
1
vote
1answer
53 views

Phishing Project Webbug Implementation

Here comes the next round. I've implemented some of the suggestions from the previous review. That being said, though, there are a few things that I have on the horizons but haven't yet put in that ...
7
votes
2answers
152 views

Simple inbox functionality using JavaScript and Ajax

I've been developing a simple CMS both for practical use and learning about Laravel, and I decided to implement a simple service that makes it possible for the administrators to send messages to one ...
3
votes
1answer
59 views

Phishing Project Error Logging

Moving on to the next steps! Previous review was here. The idea here was to implement suggestions made by @hd/@Pimgd and then implement an effective way of tracking and logging results when an ...
7
votes
2answers
679 views

Phishing Project Assessment

Coming back for another look at my project after I've reworked a few of the key points made in my previous post here. So far, I've rewritten most of my code to address SQL Injection. I've created a ...
0
votes
0answers
270 views

Laravel Unit Test for API

I'm currently building an API with Laravel 5 and I've written some unit (or integrated?) tests for it. I've been reading a little about unit test and how to not overdo it and I would like some input ...
0
votes
1answer
34 views

Single endpoint for ingoing mail with multiple purposes

The following code is not one of my proud moments. In its initial state, I had only a single purpose, but know I'm up to three purposes and I don't know if it would stop there. I'm using mailin.io to ...
6
votes
1answer
223 views

Phishing application God class

This project is ultimately my senior thesis to graduate from college. It will end up being very long with several code reviews and redesigns. The next rubberduck perhaps? I've been working on a ...
2
votes
1answer
39 views

Database query with Eloquent

I have got two tables articles and tags in the database. My goal was to retrieve all fields from articles table and one category field from tags table with Eloquent. I couldn't do this so instead I ...
1
vote
1answer
157 views

Basic CRUD in Laravel 5.2.37

Controller class ...
0
votes
2answers
70 views

Logging in with multiple types of info

I'm trying to let users log in with multiple columns (e.g. ID, email, phone). If one fails, it checks the next column. I would like to minimise my if and ...
0
votes
1answer
94 views

Laravel dropdown list without empty values

I'm creating dropdown list from all possible cities in database, all cities are distincted. ...
0
votes
1answer
176 views

Laravel transactions with a database

I'm really concerned about my transaction with a database and my code structure. I have created more methods to insert, update, delete data to the database but sometimes some of them will break or ...
6
votes
1answer
104 views

A Search Engine Class

I've built a Search Engine class for a website that permits to search companies in base of their locations and their categories (companies pay a plan to be found in the places that they will). In the ...
1
vote
1answer
70 views

How to optimize Method Visibility and code structures for better performance?

I'm creating an application to get data cross domain all the line of code seem work as well but I'm not much understand about performance with my code process with the real server and real action ...
-1
votes
1answer
66 views

Authorizing users for POST requests

I've to authorize some users to do POST requests from their CMSs in order to create a new resource on my database. I've to send a JSON response containing the status of the response (successful or not)...
0
votes
1answer
42 views

Repeating HTML, minus a few class and array key differences

I feel like this code is pretty sloppy and can be accomplished in a foreach loop. But it's a bit complex using a multi-dimensional array. Can this be cleaner? You ...
3
votes
1answer
222 views

Accessing Data inside Presentation Layer from API: Laravel 5.2.27

I wrote the code to fetch the JSON Data. For that I tried to do this in 2 projects. First Laravel project which has API code for database interaction only. Sample code in API controller <...
2
votes
1answer
960 views

Profile picture upload method in Laravel 5.2

I am a Laravel newbie so please forgive me for my code... I have a method, in a Laravel controller, that updates the current logged user profile (...
0
votes
2answers
193 views

Dynamic reports to Laravel view into HTML table

The getDynamicTeacherCount function is generating number-based reports from the table that I have in database and the ...
0
votes
1answer
809 views

Laravel bulk insert optimization

I'm currently using a make shift INSERT on DUPLICATE UPDATE function that relies on a DB raw query from eloquent. I'm looking to improve the quality of the code and the speed. Please take a look <...
4
votes
1answer
65 views

Generating statistical reports

I want to generate statistical reports and I have many different where clauses so the function became long. I did much refactoring, but it is not enough. Can ...
4
votes
1answer
273 views

Eloquent methods to calculate the average rent of apartments

I am working on a Laravel 5.1 website where I am counting the average rent of apartments in a specific area. Besides of that I want to get the average rent by amount of rooms in the apartment. The ...
1
vote
0answers
56 views

Proper PHP array walkthrough

I am working on a ticket reserving system right now. The users can reserve seats in a cinema for every movie. Whilst my code works, it is not the fastest. When a customer buys ticket (seat(s)) I check ...