Questions tagged [laravel]

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

26 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
65 views

Serving Laravel public/ contents when all Laravel files are in the same server directory

I have a Laravel 8 project hosted at xxx/laravel/ on an Apache server, where xxx is the domain. I want to serve the contents of <...
Ichi's user avatar
  • 93
3 votes
0 answers
2k views

My implementation of repository pattern in Laravel 5.6

...
Latheesan's user avatar
  • 283
3 votes
0 answers
623 views

PHPUnit testing my custom helper Facade classes in Laravel 5.5

I have been reading up on TDD and it's something I genuinely want to learn and be good at. This is something I haven't been doing as a developer and I thought it's about time I get into it. These are ...
Latheesan's user avatar
  • 283
3 votes
0 answers
873 views

Laravel Testing: Is this testing too much of the inner workings?

So I'm using laravel for a project and have a InvoiceRepository and a InvoiceRepositoryTest and I have written the test first ...
toonevdb's user avatar
  • 131
2 votes
0 answers
92 views

Ecommerce site shipping data

I have REST API written on laravel and front end on vue.js. It is a dashboard for an ecommerce store where you can connect to post shipment service API to upload order shipment data and get tracking ...
Roman Shevchenko's user avatar
2 votes
0 answers
48 views

Laravel testing for compatibility between old and new password-hashing schemes

I currently have an event listener tied to Laravel's Attempting class. The listener is designed to rehash an old password to something newer. The current DB stores ...
ThePoet444's user avatar
2 votes
0 answers
54 views

A cleaner way to track model changes

The application I'm currently working on have two main user types, let's say user and reviewer. I need to create a functionality ...
Fortunaglobal Development's user avatar
2 votes
0 answers
72 views

PHP - Transforming text content according to rules then persisting to database

I have a web application where my users can upload text documents and emails into what I call Streams. A stream is like a "stack", that holds all emails / documents. My users can then add ...
oliverbj's user avatar
  • 257
2 votes
0 answers
75 views

Search query to find articles on website with certain tags

I have the following search query to find pages on my website where I'd like to make as much as possible use of existing functionalities to determine relationship names and to hardcore the least as ...
Tschallacka's user avatar
2 votes
0 answers
383 views

SQL/PHP Laravel - Looping through records to find relationships

I have two tables in my database, which contains a big list of organisations. They are called orgs_main and orgs_sub. This is ...
oliverbj's user avatar
  • 257
2 votes
0 answers
48 views

Laravel - Add different style to type of product

I'm working on a project where I have products. Each product can either be a theme, plugin or a plan. Now my idea was to add different styles to each of the types. For instance, Theme is red, Plugin ...
Rainier Laan's user avatar
2 votes
0 answers
614 views

Laravel polymorphic usage

I am fairly new to Laravel and have implemented a many to many polymorphic relationship to a model where you have two tables that act as polymorphic references one is for content (text information ...
Mark Watson's user avatar
2 votes
0 answers
26 views

Login Controller follow-up

I was wondering if this class can be refactored to be more efficient. I've taken tips from other people who have already helped me refactor it a fair amount, but I was wondering if there was any last ...
Danny Evans's user avatar
2 votes
0 answers
338 views

Steam Auth for Laravel

I'm not expert on OpenID, so i don't know if my package is correct and safe. I've realized that after login on Steam community, take about 2/3 seconds to return to my page. It's my issue or is from ...
user avatar
2 votes
0 answers
193 views

PHP tagging script

I have created this PHP script in Laravel. I have database table with items and in my app I can create tags with different regexes. If regex matches text in description or epoch. I will insert ...
user2351471's user avatar
2 votes
0 answers
779 views

Extended Laravel Eloquent models to add filters to model setters

One of the tasks I find myself doing repeatedly is to filter the incoming inputs that will be stored in models. Examples of this include trimming, removing repeated or unnecessary pre/suffixes, commas ...
Yi Jiang's user avatar
  • 530
2 votes
0 answers
632 views

Passing standard data through serviceprovider

I am using Laravel 5. To pass the users his favorites and permalink, I edited the AppServiceProvider. I was wondering if my solution is the most reasonable solution....
Szenis's user avatar
  • 121
2 votes
0 answers
269 views

Decoupling payment classes

I have several classes for payment handling, I separate these classes into directories like below. Actually I'm going to use it for Laravel project but to make it simple, maybe we can talk as if it's ...
xdim222's user avatar
  • 121
2 votes
0 answers
3k views

Laravel 5 Dependency Injecting a Repository into a controller, and depedency injecting an entity into repository

Overview:: I have a Restful API that pushes all /api/{version}/{Repository} into my ResourceV{1}Controller depending on the <...
Dustin Parham's user avatar
2 votes
0 answers
576 views

Immediately send redirect response, preserving session data

This question is for Laravel 4 only, as the relevant parts are completely refactored in the upcoming Laravel 5. I have written an helper function for validation, so I only have to put this in ...
Gras Double's user avatar
2 votes
0 answers
642 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 ...
Carlos Arturo Alaniz's user avatar
2 votes
1 answer
108 views

Controller in Laravel with parsing, creation and relationships

The following code represents the store method of a resource controller. A user can create an training offer on my website and can pass various information like ...
Adam's user avatar
  • 345
1 vote
0 answers
88 views

Github API based backend using Laravel

I just created a Github API based backend, this api retrieves and stores information from the github users api app/Http/Controllers/GitController.php ,I am using Requests, Actions and services ...
DeveloperX's user avatar
1 vote
0 answers
248 views

Error handling for Laravel REST API client and server using bearer token authentication

I would like to query a REST API (which uses Bearer token authentication), handling several exceptions that might occur. Could you tell me if the following code (which I explain later in this post) is ...
JarsOfJam-Scheduler's user avatar
1 vote
0 answers
62 views

Providing JavaScript Configuration (Laravel config() style)

This may be better suited on Stackoverflow, in which case, please let me know and I will move it over... Background Consider the following file structure: ...
Ben Carey's user avatar
  • 199
-1 votes
1 answer
481 views

How to avoid multiple query to get child relationship count in Laravel one to many Realtionship

I have 3 tables: regional with Regional Model (id,kode) status_kontrak with StatusKontrak Model (id,status,user_id,...,...) users with User Model (id, regional_id). My purpose is to get a collection ...
Matius Nugroho Aryanto's user avatar