Questions tagged [laravel]

Laravel, a remarkable web framework built on PHP, empowers developers to craft extraordinary and expandable web applications. Find the source code of Laravel hosted on the renowned GitHub platform, released under the highly flexible MIT license.

Refreshing a Laravel page may sometimes lead to a delay of up to 4 seconds for the complete loading of the

I am new to working with Laravel's framework, so please correct me if I'm wrong. I have set up templates with assets (css and js) in their respective folders: SASS and JS are placed inside resources/sass and resources/js respectively, which then get comp ...

Utilize an optional parameter within a route configuration

Is it possible to use the same route in two scenarios? Using the route without passing a parameter Using the route with a parameter If so, how can this be accomplished? ...

Retrieving Data from Database Using Laravel and Ajax Post-Update

I am facing an issue with my edit form, designed for admins to edit book details. Upon submitting the form, the values are updated in the database successfully. However, the page fails to load the updated values into the form without requiring a refresh/re ...

Dynamic number of parameters in Laravel routes

I'm attempting to develop a route that includes a mandatory parameter followed by an indefinite number of parameters. The exact count of additional parameters is uncertain, but it will always be more than zero. <?php Route::get('{tree_slug}/{ ...

Is there a way to specify a custom model type in lighthouse-php under a different name?

When working with the Lighthouse package for GraphQL in Laravel, I have a model named "ClassA" that needs a type declaration as "TypeA". What is the recommended best practice to achieve this? ...

Setting up AWS Elastic Beanstalk for a Laravel application with customized Nginx configuration

Recently AWS has made a change in the Elastic Beanstalk PHP environment by switching to Amazon Linux 2 and replacing Apache with Nginx. I have been facing challenges in configuring my Laravel project to function properly. Previously, I could simply add som ...

Exploring Search Functionality with Vue.js 2 and Axios: Implementing API Filtering

I am currently trying to sort through a list of films that I have retrieved using axios. The purpose is to compare them to a search string for a search feature. Everything seems to be working fine, except when I use the computed property, it gives me an er ...

Integrate AngularJS with Laravel for efficient routing management

In my current web app project, I am utilizing AngularJS and Laravel for the development. Below is a breakdown of how my routing is set up: AngularJS: angular.config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRo ...

Tips for resolving the issue of table rows becoming detached in Laravel when using Vue.js: How can I prevent my table rows from being split

I am facing an issue while trying to create a table using Vue.js and Laravel. The problem is that each row of the table data is being displayed as a separate table. Despite making changes to the code in both Vue and the controller, I cannot seem to resolv ...

Develop dynamic interactions with Laravel and Vue.js by creating bindings to multiple class names

In my Vue component, I have a feature that displays a list of items. Each item can be flagged as "active" with a boolean value which is then saved to a database. For example, out of five total items, three could be marked as "active" while the remaining t ...

Issue with radio button functionality while iterating through loop

I am currently working on a form where users are required to select one answer from each question using radio buttons. The loop logic allows for the selection of one answer per question. <form method="POST" action="{{url('quiz/check')}}" {!! ...

How can Laravel integrate Elasticsearch to retrieve documents based on multiple categories?

After successfully implementing the code snippet below to retrieve blog posts based on a query, I encountered an issue when attempting to fetch documents that match specific categories. $params = [ 'index' => 'blog', 'type' => 'p ...

Generating VueJS Syntax from JSON Data

My goal is to retrieve locale language variables from a JSON Request generated by Laravel and load them into VueJS. VueJS does not natively support locales, so I am facing issues with the ready function alert not working while the random text data variable ...

Is it possible to make changes to Vue data within a function while in the process

Recently delving into the world of VueJs, I find myself navigating through laravel 6.0. While grappling with the concept of variable scopes in javascript, I sense there might be a missing piece in this puzzle. It's interesting to note that when I pla ...

Laravel's Vue component is experiencing issues with loading Axios response data

Hey everyone, I hope you're all doing well! I'm facing a bit of an issue with passing data from an axios response to the data property. The data is successfully fetched from the database and displayed in the console, but when I try to display it ...

Real-time chat functionality using Laravel 5.2, socket.io, and private messaging with redis

TLDR; Seeking best solution for private instant messenger integration with Laravel. I currently have a live real-time chat feature on my Laravel website, but I am missing the ability for private messaging. The chat is located on the home page and every ti ...

During the compilation process, V8Js encountered an error (ReferenceError) on line 9272, specifying that the

<?php namespace AppHttpControllersAuth; use IlluminateSupportStr; use IlluminateSupportFacadesDB; use IlluminateHttpRequest; use AppHttpControllersController; use AppModelUser; use IlluminateSupportFacades ...

Error 405 (Invalid Method) in VueJs: You are not allowed to use

I have a route defined in the group with 'prefix'=>'admin' in web.php Route::post('/slideUpdate/{id}','SlideController@postSlideUpdate') In Add.vue, I am calling the update() function in methods axios.patch(`/admin/slideUpdate/${this.list.id}`, this. ...

Tips on Enhancing a Fetch Query in Laravel with the Help of Ajax

I am encountering difficulty fetching a list of cities with over 40,000 entries. The main issue is the lack of optimization as my browser becomes unresponsive while loading the city data. Within my Laravel Controller, the code snippet below showcases how I ...

The ID attribute of Laravel blade file input is missing

Within my blade file, I have the following line of code: {!! Form::file('motivation', old('motivation'), ['id' => 'inputGroupMotivation', 'class' => 'custom-file-input']) !!} Although I ha ...

When data is updated in Php Laravel, a new record is inserted instead

Hey there, I'm facing an issue when trying to update data in my table; instead of updating the existing record, a new one is added. Here is my update method: public function update(CompanyUpdateRequest $request, Company $company) { try{ ...

Transmitting document through HTML form using Laravel integration with Mailgun API

I'm currently working on a feature where users can select a file via an HTML form and have it sent as an email attachment using Mailgun. I want to avoid storing the file on my server. The goal is to allow for uploading various file types such as PNG, PDF, ...

Having trouble with Vue component not showing updated data after axios POST request issue

Hi there, I'm facing an issue and could really use some guidance from a skilled Javascript Wizard. Here's the problem: I have a Laravel collection that I'm passing to a Vue component. Within the component, I am looping through the collection and submitti ...

encountering issues with displaying data on webpage when utilizing ajax

I've been working on adding a search feature to my user admin page, using AJAX for search functionality. However, I'm encountering an issue where I am unable to display the data on the page and keep receiving errors. Despite trying to enclose every side w ...

What is the best way to incorporate multiple conditions within a single foreach loop?

Is it possible to have multiple conditions in a single foreach loop like this: "foreach($products as $product && $categories as $category)"? If not, what would be the correct way to proceed? ...

What is the best method for integrating jQuery FullCalendar using AJAX?

I need assistance loading a full calendar using Ajax. The data will be passed from the controller in JSON format, but I am unsure of how to implement it. Can someone please help me with this? Here is my controller code: public function calenderHoliday(){ ...

Error in JavaScript with Laravel Mix/NPM.js: The variable twemoji.parse cannot be found or is undefined

Greetings everyone, Currently, I am using Laravel Mix to integrate Twemoji and other modules through Node. Unfortunately, I am encountering console errors indicating that the dependencies are not loading correctly. One example of this error is: TypeError ...

The processing time for this request is unreasonably long

My website is built using Laravel and Vue.js. I am facing an issue where a function takes more than 2 minutes to execute, resulting in the following error: 500 Internal Server Error Request Timeout This request takes too long to process and is timed out b ...

Troubleshooting the 403 error in Laravel 5.2 with AJAX POST requests

I'm experiencing difficulties with Laravel 5.2, specifically when attempting an AJAX POST request, I encounter a 403 error Here is the code for the AJAX POST request: $.ajax({ headers: { 'X-CSRF-Token': $('meta[ ...

Retrieve the data exclusively when transferring information from Laravel to JSON

I am facing a challenge in my Laravel project where both the key and value are being passed to the variable I assigned when attempting to pass data in JSON format. I have tried using $data = json_encode($ip); inside the controller, but only one result is r ...

Transmit information from a Vue.js application to a Laravel application

I've started working on two separate projects - one using Vue.js (created with vue create project_name) and the other using Laravel (created with laravel new project_name). My goal now is to transfer data from the Vue.js project to the Laravel project ...

What is the technique for including a parameter in an Inertia lazy loading call?

When the initial page loads, specific products are loaded. However, I am looking to load missing products partially based on a foreign key. To achieve this, my idea is to return two props from my Laravel controller. These props are 'products' and the lazy ...

Encountering an issue while trying to create a Vue3 Vite application because of the assignment of a read-only property 'name

I am facing an issue with my Laravel app that utilizes Vite, Vue3, and Inertiajs. Previously, I was able to build it successfully. However, now I encounter the following error: Cannot assign to read only property 'name' of function '(userOptions) => { ...

show the json output

After sending a JSON post request and fetching the return data, I have encountered an issue with displaying the response correctly. $.post("/employees", {id:"3"}, function(response){ if(response.success) { var branchName = $('#branchname' ...

What is the most effective way to conceal the textbox when one of the select option boxes is chosen?

<div class="flex w-full"> <select placeholder="Sort By" v-model="criminal.sortBy" class="bg-grey-lightest border p-2 border-gray mr-4 h-10 w-1/2 rounded-sm font-basic mt-2 mb-4"> <option>----------------------- ...

Laravel Rest API and Github Authentication for Next.js login

I am facing an issue with GitHub authentication login. My setup involves using Laravel API for the backend and Next.js for the frontend. The goal is to allow users to log in with their GitHub accounts. I have already installed the Laravel Socialite package ...

Troubleshooting Vue Component Visibility Issue in Laravel 5.4 with Passport Integration

Implementing passport using Laravel 5.4 has been a smooth process following the official documentation step by step. All was going well until I reached the "Frontend Quickstart" section. After executing the command to publish the vendor: php artisan vend ...

What steps should I follow to generate an array index within a foreach loop?

I need help transforming an array into a specific format. Currently, I am using a foreach loop to iterate through the array. $role_rights = array(); foreach ($write_read_permission as $k => $val) { $role_rights['menu_url'][] = $k; $category = ...

Error in Laraval Breeze: Vue component is missing page or props definition

Hey there, I'm currently working on developing a web application using the Laravel Breeze framework which incorporates Laravel, Vue.js, and Inertia.js. I've made significant progress so far, but I'm encountering an issue with utilizing the data passed fr ...

Having trouble with unexpected ternary statements appearing in Laravel Blade?

In one of my blade templates, I have a function call that should receive a string as its first parameter. However, Laravel seems to be interpreting the string and adding a ternary operation because it detects a '?' symbol followed by 'or'. Here's the issu ...

The process of running the "NPM install" command line is not compatible with the directory in a Laravel project

I am eager to learn how to use webpack with Laravel and have been attempting to integrate Mix into my Laravel project. After successfully installing node and npm, I verified the versions by running 'node -v' and 'npm -v' in vscode, whi ...

Utilizing Laravel: executing several functions on a single object instance

As someone who is new to laravel and OOP, I find myself facing some challenges with facades that I can't quite understand. Let's say I am working on a class in PHP to interact with an API and create shipment labels for ecommerce orders. The class has prop ...

Creating immersive 3D graphics using Three.js

Exploring three.js for the first time and experimenting with displaying a basic 3D model using three js, Vue, and Laravel. The 3D file can be found at /public/files/Tree1.3ds. Need help rendering the file in the Vue component with three js. Initially tried ...

Encountering ELIFECYCLE error due to Laravel NPM

When attempting to run "npm run dev" with my Laravel project, I keep encountering an error "ERR! code ELIEFECYCLE." I've experimented with numerous solutions and even went through the steps outlined in this post: laravel npm run dev ERR! code ELIFECYCLE F ...

Retrieve values from a database table in Laravel by comparing the IDs stored in one table in JSON format with the IDs in another table

My database table is called journal_details and it contains a column named transaction_by_to. I store values of account_head_id in JSON format within the transaction_by_to column of the journal_details table. Now, I need to execute a select query to retrie ...

Stop the execution of the setTimeout function when the webpage loads in JavaScript

In my postgres database, I have a table named students for storing student information. The structure of the table is as follows: id first_name last_name time_remind 1 pers1 pers1_name 2022-07-30 21:30 2 pers2 pers2_name 2022-07-30 20:38 Current ...

Socket connection issue causing Laravel Event not to display on registration

I want to display notifications for new users who have registered on my website, so that existing logged-in users can see messages like "blabla has registered...". To achieve this, I first created an Event class along with a channel setup: class UserSign ...

Using Laravel with Vue and <router-link> does not update the content as expected

For my project, I am using Laravel with Vue. On the main page, I have listed all articles and when a user clicks on a specific article, a new page opens displaying that article with other prominent articles shown on the side like this: .https://i.stack.img ...

Unable to invoke a static method within a Model in PHP

$page = new AppPage::find('page', $pageName); Encountering an error: Syntax error, unexpected 'where' (T_STRING), expecting variable (T_VARIABLE) or '$' Could anyone please point out the issue with the initial line of code? ...

Laravel 8 - utilizing two foreign keys referencing the users table

I have an idea for an application that allows two people to create a meeting room, but I'm unsure of how to create the schema in Laravel. This is my attempt so far: Schema::create('appointments_tables', function (Blueprint $table) { ...

Laravel route does not receive a parameter sent via Ajax

I am currently using Laravel 5.8 and implementing a discount code system on my website. To achieve this, I attempted to send data via Ajax in the following manner: $.ajax({ type: 'POST', url: baseurl + 'discount/register', ...

How can Laravel's route() function help generate links with unique domain names?

When defining my routes in the web.php file of Laravel, it looks something like this: Route::get('/landing')->name('landing'); To generate links for this route, I use the following code: route('landing') The link that ...

Does the DateTime class in PHP create issues within Laravel 5.1?

After implementing this code in my Laravel 5.1 project's controller: $start_date = "2015-06-10"; $date = new DateTime($start_date); I encountered a persistent issue when running the code on both Chrome and Firefox. My website would become unresponsive at ...

Passing a Vue.js variable to a Laravel Eloquent model in a Laravel Blade template file

I attempted to include attribute_id in an Eloquent query, where attribute_id is a variable from Vue.js. However, I encountered the following error: Use of undefined constant attribute_id - assumed 'attribute_id' <div v-for='(attribute_ ...

What is the best way to implement a left join using Laravel's join function?

I am struggling with implementing leftjoin and join in Laravel. I need help rewriting the following sample code using Laravel methods. LEFT JOIN (advertsolution_f SF JOIN function_d FD ON SF.fd_id = FD.fd_id JOIN function_m FM ON FD. ...

Access your Node.js application by using the address on your Laravel Forge server

My Node.js app is successfully running on Laravel Homestead, but I now need to transfer it to the server. I am using Laravel Forge for server provisioning and all the necessary Node packages are already installed. While testing locally, I use Homestead&ap ...

Encountering a 500 error (Internal Server Error) while trying to connect API Laravel 5.4 with Angular 2

Every time I try to submit a form from an Angular form to my API built on Laravel, I encounter a 500 error (Internal Server Error) in the console. What could be causing this issue? Note: The backend API functions perfectly when tested with POSTMAN. This ...

The Laravel background-image:url function is yielding a result of 1

Currently working on a web application built in Laravel and encountered an issue with the code snippet below: <div class="user-info" style="background-image:url({{ asset(Auth::user()->partner->background) or '/images/default/background1.jpg& ...

How to retrieve the localhost URL in Laravel with Transbank integration

I am a complete beginner in using Laravel. I have been working on a project involving Transbank payments, and everything seems to be working fine. However, I am facing an issue when trying to return to my localhost path after a transaction. When running L ...

Deleting associated records in LaravelLaravel gives you the ability

Managing soft deletion of departments when a company is soft deleted can be tricky. The current implementation involves iterating through each department associated with the company and soft deleting them. However, it seems that only the first department i ...

Implementing an OnChange Event for a Multi-Select Feature in a Vue.js Application

Here is the HTML code for my multi-select input: <select id="invitees_list1" class="form-select" multiple name="multi"> @foreach ($seatedTable->invitees as $invitee) <option> {{ $invitee ...

Securing Laravel AJAX calls with CORS and CSRF Tokens

Is there a way to provide a CSRF token for cross-domain (subdomain) requests in Laravel? Both the domains domain.tld and sub.domain.tld are operating under the same Laravel Framework. Although I can use csrf_token() in sub.domain.tld and directly attach ...

What is the best way to customize the cache "get" method in Laravel?

Need assistance in overriding the method get() from the class Illuminate\Cache\Repository. Here's my code snippet: <?php namespace App\Illuminate\Cache; use Illuminate\Cache\Repository as BaseRepository; class Reposi ...

Adding an object in Laravel relationships can be achieved by utilizing the relationship methods provided

How can I include additional objects in a Laravel relationship when fetching data? This is my code snippet: $list = new self; $list = $list->where('uuid', $uuid); $list = $list->where('user_id', $user->id)->orWhere('to_user_id', $user->id); ...

Retrieve the HTML data through Ajax in a Laravel DataTable with the assistance of the yajrabox package

Utilizing the package to incorporate an ajax datatable in my Laravel application. Within my controller class, I have implemented the following method for returning data for the datatables: function ajaxList() { // Fetch users with related groups and ...

Tips for saving multiple pieces of data in a single field with Laravel

Is it possible to save multiple data at once using a simple form? controller $status= new PostTable(); $status->language = $request->language; blade <input type="checkbox" value="hindi" name="language[]" id="language"> Hindi model pro ...

Updating multiple rows in Laravel using input data

Check out the app here I recently created a multi-row update feature with JavaScript. The button function successfully retrieves the ID of each row, but now I'm facing a challenge. I want to include an input form for the data that is being updated. ...

Complete the form to redirect to a new webpage

I'm facing an issue here, wondering how I can submit a form on one URL and another form on a different URL simultaneously... For example: form1.php: <form> <input type="text" name="name" id="name"> <input type="submit" href ...

The ongoing saga of `npm run dev` seems to have no end in sight

I've been attempting to integrate Vue into my Laravel project, and I've followed all the necessary steps: Installed Laravel/UI using composer require laravel/ui Ran php artisan ui vue Included the in my main layout file app.blade.php Ran npm run dev How ...

Custom Laravel Authentication Rule

Currently, I am working on integrating Laravel Auth into my project. I am attempting to implement a new rule where users with a status of 1 in the user model are not allowed to login. However, I am struggling to find the exact location to add this rule. I ...

Making changes to a value in Laravel through an API request

I've been attempting to modify the handicap score through a post request, but I keep receiving an error message which says: creating default object from empty value. Here is the code snippet: public function handicap(Request $request) { ...

Laravel Eloquent model, text being cut off at maximum length

While working with Laravel, I encountered an issue when loading a database row into an Eloquent object. The problem arose from one of the columns being a longtext type containing a JSON encoded array with over 2 million characters. The original error I fac ...

Showing a Vue component within a Laravel Blade template

Currently, I am performing a basic calculation within app.js by multiplying the product price with the quantity. My goal is to showcase the total value in Laravel for users to preview their order. app.js const app = new Vue({ el: '#item', ...

Laravel has not been properly initialized

Recently, I've been exploring Laravel 5.3 and vue.js and I'm trying to make a GET request to fetch some user data from my database. I'm utilizing components in this project. Here is a snippet from my app.js file: require('./bootstrap ...

How can we shift some of the value to the initial value in an array? (See visual representation)

In the image below, you can see my array. I am looking to transfer the values highlighted in yellow boxes to the first value, as all these values have the same furniture_id marked with a red circle. Is there a way to accomplish this task? https://i.stack. ...