Skip to main content

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.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
6 views

Route code is not working [closed]

I am writing this rote but it's not running, I am doing training in Laravel framework. ...
6 votes
1 answer
488 views

Laravel session handler for Phpbb sessions

Ok, so I am developing a Laravel 5.5 app that needs to interface with an existing phpBB forum. Specifically, if you log into the phpBB forum, you must also be logged into the Laravel app. Otherwise, ...
5 votes
1 answer
2k views

Setting default of <options> in Laravel with PHP Match

I have a filter component that lets a user filter for events on a website. The user needs to see which category is currently selected in the filter. For this there is a URL with parameters. e.g. ...
3 votes
1 answer
103 views

Laravel seeder for email template settings

This is my Laravel seeder for two database tables. I need to make this seeder more efficient and optimized. How can this be achieved? I would appreciate some tips. ...
3 votes
3 answers
679 views

Sanitize URL string for Insertion Upon DB table via Eloquent model

In my case I am saving a URL into my database via Eloquent Model: ...
3 votes
1 answer
180 views

Sending only modified data from a table to the backend as form data

The frontend has a table with hundreds of rows. Each row consists of different inputs (text, file, ...
1 vote
0 answers
168 views

Handling large amount of traits and properties in classes

I've got an open-source project that I've been working on for a while, and I'm looking for advice on handling large classes. It's a Laravel 10+ package for building forms, and everything works fine, ...
2 votes
1 answer
163 views

Manually inserting or updating a row with timestamps, without Eloquent

I need to insert or update a row that has created_at and last_update timestamps. created_at ...
2 votes
1 answer
78 views

methods to import deposits and trades

I run a large scaled app much larger than I can handle or develop for, website grew out of control and currently has over 22000 users. We support importing from different APIs, each import is split ...
1 vote
1 answer
115 views

Laravel Eager Loading tickets from DB

So I have the following relationship in my Model: Events Model: ...
2 votes
1 answer
62 views

Production-Readiness Advice for Laravel/ PayPal Integration

I am currently working on integrating PayPal with my Laravel application, and it's my first time incorporating PayPal for production use. I have written the following code and would greatly appreciate ...
3 votes
3 answers
151 views

My PHP function that reads names and attempts to fix the suffixes

I am reading a text file that has some name inconsistencies. For example I have names like: ...
5 votes
1 answer
790 views

Update specific model attributes from a request

Background This is for an API and I'd like to use this Upsert action to take data from a request and only update the requested fields. I.e. These are partial updates and I will not update every field ...
2 votes
3 answers
2k views

How to reduce a POST request duplicate in Laravel/PHP for payment system?

I'm using PHP/Laravel and I have two controllers. Controllers/PaymentController Controllers/PaymentExpressControler They both create an request which is exactly the same, but it has some differences....
2 votes
1 answer
480 views

PHP / Laravel - Using Python to image manipulation

I have a simple job class in Laravel, that will do the following: Get all the images in a folder /original Perform some image manipulation on each image Save each ...
4 votes
1 answer
196 views

PHP - Saving inbound email and its attachment

I have the below code, which handles inbound emails in my application, saves the actual email content (text + attachments) to my database, and the saves the actual attachment files on the server. In ...
0 votes
1 answer
253 views

Default to array when value is null or false

I'm working with ACF in WP which provides a get_field() function. The function can return an array of values, null or false. ...
1 vote
1 answer
98 views

Is there any sugestions how to make this script faster if its possible?

I wrote a script that uses an uploaded excel file to import data to the database. It checks for the image first if it can be downloaded without any error then insert the rest of the data. With ten or ...
5 votes
1 answer
291 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 ...
3 votes
2 answers
225 views

Laravel Event Filtering Controller

So I am currently writing a function in laravel that handles URL parameter filters. How the code works: So we have the following two URL parameters: timeframe and <...
1 vote
0 answers
91 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 ...
1 vote
1 answer
396 views

Three way Eloquent relationship definition and saving in Laravel

I'm building a Laravel app (with Vue3 and InertiaJS), and I'm attempting to create relationships between three models: User Area WorkHours where WorkHours is the ...
1 vote
1 answer
118 views

Theme picker for Laravel 8 blogging application

I am working on a blogging application in Laravel 8. The application supports themes. In a nutshell, theme support works like this: In the views directory, I have ...
2 votes
2 answers
488 views

Route protection with custom middleware in Laravel 8

I am working on a blogging application in Laravel 8. The application assigns users roles and permissions. There is a many-to-many relationship between roles and permissions. I have created a custom ...
3 votes
1 answer
550 views

Adjusting variables on change of status attribute of my Order Laravel model on the updated event in observer

I have an order model and a client model. A client has many orders, an order belongs to a single client. In the client model I keep track of how much money a client paid (...
4 votes
2 answers
5k views

Laravel 8 registration and login with user profiles

I am working on a Laravel application (Github repo) that requires user registration and login. After registration, the users can change their registration details (except password, for which there is ...
4 votes
2 answers
2k views

Full text search for multiple words using Laravel and MySQL

I'm using Laravel 5.6 and MySQL. I need to search multiple columns for a single word or multiple words (e.g., "camhandle", "cam handle"). The way I was originally doing it was just ...
3 votes
1 answer
261 views

PHP Laravel Check if given date is a week or a regular day

I have a problem. In my project the user can copy a menu for a specific day or for a specific week. The value that will be sent to the back-end will be something like: ...
4 votes
0 answers
67 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 <...
9 votes
2 answers
722 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 ...
2 votes
2 answers
158 views

Laravel PostController

I'm new at Laravel and I got an assessment task from company where they want me to create a mini-blog with Users and Posts. I was using following methods: index, create, show, store, edit and destroy ...
1 vote
2 answers
258 views

Laravel 8 blogging application

I am working on a blogging application in Laravel 8. In the FrontendController controller I have: ...
0 votes
4 answers
608 views

table name column name from GET parameter

This is a function that reads a setting data from DB. ...
2 votes
1 answer
251 views

Optimization of laravel pivot table relationship

I have a pivot table called invite_riskarea which is designed as follows: This table stores the permissions that have a specific user (through an invite id) to ...
1 vote
2 answers
77 views

Check if a new movie session can be inserted

I have this function in my code, this way I validate if a new movie session can be inserted, it works, but I wanted to find a better way to do it. ...
2 votes
1 answer
404 views

Laravel 9 - Metadata creation using middleware?

I wrote a middleware for laravel that grabs the current metadata for the specific URL you visit. How it works: we use the $request and compare the current URL: <...
0 votes
1 answer
65 views

Laravel controller getting results based on parameter including relationship results

I am trying to learn to improve my coding on a daily basis and this is one of the first times I am posting on here, so bear with me. I have two models, a Payment and an Expense model. A ...
1 vote
1 answer
94 views

Choose meals for a week

I've built this complex form or at least what I would consider a complex form and it feels really dirty. It felt dirty while I was programming it but I wanted to get it working and then go back and ...
1 vote
1 answer
1k views

Placing store and update logic in Laravel 8 form request

I want some opinions about my code that implements store and update for a Laravel 8 form request. The make function is for storing the data and the ...
1 vote
1 answer
307 views

Laravel show and update currency from rest api

I need: Daily save new exchange rates from the REST API in the database. Return the current exchange rate for a given currency, the whole table for a given day, the exchange rate for a given currency ...
3 votes
1 answer
50 views

Retrieve config values using custom helper

I've stored a set of theme related configuration in a config file. config/theme.php ...
1 vote
1 answer
78 views

Search controller logic to search through models and manufacturers

I have the following Laravel controller that searches through two models - Manufacturer and SearchTerm (which contains models of manufacturers, synonyms of models as well as common misspellings) using ...
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 ...
0 votes
1 answer
77 views

Show a search input bar depending on which path the user currently is viewing

I'm using Laravel with the Blade template engine. I'm trying to show a search input bar, depending on which path the user currently is viewing. The three paths are ...
4 votes
2 answers
7k views

Get collection in blade and check if empty

If I want to display the addresses of a user in a blade file I do it like this: ...
4 votes
1 answer
119 views

manage projects with Scrumpoker

I wrote a page with Laravel to manage projects with Scrumpoker through blade syntax with controllers, models and Vue.js. My problem is that I wrote the actual Scrumpoker in a single file.php file and ...
2 votes
2 answers
1k views

Laravel controller for form validation skinny

I'm trying to make controllers skinny as possible. I use repositories for accessing the database and I use Services to do other stuff. In this case, I use it to insert a new post to the database. For ...
9 votes
2 answers
16k 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: ...
-1 votes
1 answer
491 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 ...
2 votes
2 answers
83 views

Controller method to store course

I have this controller method to add a course and it works fine but I really don't like this code because I think it's too large and a little bit ugly I was trying to do it cleaner and a little bit ...

1
2 3 4 5 6