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.

Laravel 5 is known for experiencing a frustrating "This site can't be reached" error message when attempting to download a file

I am experiencing an issue with my Laravel 5.2 and PHP7 setup on my hosting server. Everything seems to be working fine, except for the links that are supposed to generate and download xlsx files using Laravel Excel. Whenever I click on these links, I enco ...

"An unexpected server error occurred when using ajax with Laravel, resulting in a 500

Hi all, I'm encountering a problem while trying to edit comments using ajax in Laravel 5.4. When I click on the "edit" button in the modal, I receive a 500 (Internal Server Error). Here's my JavaScript code: $(document).ready(function(){ ...

Issue with Laravel project: Views are not updating after code changes

Despite my efforts to clear and refresh everything, my Laravel project is not reflecting the changes. I have attempted clearing the view and deleting files manually. I also ran cache:clear, changed the root folder name, but the project continues to displa ...

Two items possess an identical worth

Whenever I make edits, both objects end up being the same. What is the solution to keep them separate? I have an object that I bind to inputs using v-model in order to update it. However, when I edit it without saving changes, the original object gets mo ...

Can you determine if there are any updates that could potentially cause errors for a PHP package?

Currently, I am working on a project using Laravel and VueJs. I am in the process of upgrading Laravel from version 5.8 to 6.0 following the official documentation guidelines. The documentation advises: "Next, examine any third-party packages used ...

How to easily upload multiple images with AJAX and jQuery in Laravel

I have an issue with uploading multiple images using Ajax and jQuery. When passing the images from the view to the controller in the request, I receive all the images in the form of an array. However, only a single image is being uploaded and only a single ...

Filtering nested relations in Laravel

Is there a way to filter query results by translation relation (specifically the name column)? $item = Cart::select('product_id','quantity') ->with(['product.translation:product_id,name','product.manufacturer:id,name&a ...

Personalize the Laravel mail error handling within the controller

I am looking to personalize the error page for Laravel mail. Currently, I am encountering this error message: (1/1) Swift_TransportException Expected response code 250 but received code "535", with the following message: "535-5.7.8 Username and ...

Having trouble showing information from axios response in a Vue component

The data fetched with axios isn't appearing in the Vue component, even though there is data showing up in vue-dev tools. I'm also encountering errors like: [Vue warn]: Error in render: "TypeError: Cannot read property 'logbook_id' of nu ...

Encountered an error while building module in Laravel 6 project

I recently set up a new project using Laravel 6 and encountered an error after running `npm run watch` following the npm installation. Ahmed@DESKTOP-G216VK0 MINGW64 /c/laragon/www/larabiz $ npm run watch > @ watch C:laragonwwwlarabiz > npm run d ...

Implement a loading spinner in VueJs and Laravel to display in front of the page during the data loading process

I have implemented a loading spinner in my Vue project to display until the data is fully loaded. I created a separate component called LoadingComponent.vue for this purpose. <template> <div class="preloader" v-if="show"> ...

Laravel, showcasing a collection in the view

$fruits = DB::select("select a.id, a.created_at, a.updated_at,a.storeid, a.itemno, a.type, a.fruit from stores a, storenames b where a.storeid = b.storeid"); return view('stores', ['fruits' => $fruits]); I executed the code ...

Top strategy for managing a multi-tenant SaaS platform

I'm in the process of developing a Multi-tenant SaaS application and have been exploring various strategies to achieve this goal. I've decided to go with the approach of creating a separate database for each tenant, while storing a table of all tenants in ...

Axios: Exception handling does not involve entering the catch method

Implementing a function to adjust a contract name involves making an axios request to the backend API using a specific ID. Upon each execution, a sweetalert prompt is displayed. axios({ url: '/api/contract/' + id, method: 'put', data: ...

Eloquent in Laravel 5 makes it easy to retrieve all attributes from two related tables

Hello, I am working with two tables - Users and Posts - that have a one-to-many relationship. My goal is to retrieve all the data in just one query using Eloquent, resulting in: Users Table: id | name Posts Table: id | user_id | title| body The retriev ...

Blank page received upon submission of Laravel Select2 application

I'm experiencing an issue with submitting a form using select2. After submission, I receive a completely blank page. I'm not sure why the controller is not working properly. All I need is to send the store id. <form id='filter' action="{{ route("admin ...

Encountering a 404 error when trying to access /horizon with Laravel Horizon

Currently experimenting with Horizon on my local machine running Ubuntu 20.04, Laravel 7, and PHP 7.4 The installation process went smoothly, but upon attempting to access Horizon through http://localhost:8000/horizon, I encountered a 404 error. This iss ...

Connecting multiple collections using a shared identifier in PHP

I have a vast array of authors structured as follows: - authors (id, profile_id, title, name) -> totaling 590 authors I also have 4 collections where author.id equals author_id - sales (id, author_id, salesTotal) - subscribers (id, author_id, subscr ...

Encountering a Laravel issue within my application. Each question is followed by a subsequent question based on the provided answer. All questions and corresponding answers are stored in the database

I am brand new to Laravel and databases as I work on creating a web application for individuals facing difficulties with specific products. The app prompts users with questions and based on their answers, directs them to the next question in sequence. Each ...

Here is a unique version: "Exploring the process of merging with groupBy in Laravel using PHP when dealing with two arrays, one of which contains all data

https://i.stack.imgur.com/OurWm.jpg https://i.stack.imgur.com/ehn40.jpg Is it possible to merge arrays with groupBy in Laravel PHP when one array lacks attributes and the other has additional properties? This scenario involves working with two different ...

What steps can I take to address the issue I'm encountering while updating composer using the command line interface?

When attempting to install composer, I encountered the following error message: "Problem 1 - mpdf/mpdf[v8.0.0, ..., v8.0.3] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your php version (7.4.16) does not meet this requirement. - mpdf/mpdf[v8 ...

Appending a row to a table will not trigger events in Select2

Despite several attempts, I can't seem to get the select2:select event working on dynamically added rows in a table using select2. The event only works on the original row. Unfortunately, I don't have any additional details about this issue. COD ...

Using Vuex to fetch information from Laravel

As a newcomer to the world of vue/vuex, I find myself immersed in a laravel project that utilizes these technologies for its front end. Needless to say, I am struggling to grasp the intricacies of it all. My current challenge involves retrieving the folde ...

Retrieving JSON data in Flutter based on category

I am in the process of creating an e-commerce application. I am using a ListView.builder to show the data but I'm struggling with fetching products based on the selected category. Below is the model for the list of categories: class Category { final ...

Refreshing an HTML table with new data using jQuery and Ajax after a different selection

Currently, I have a piece of code that allows me to select two players and display some statistics about them. The data is presented using a regular table (image1). The issue I am facing is that when I select a new player, instead of updating the informat ...

Unable to verify identity using spa

My API is running on the URL: https://example.com, and my vue.js app is running on: https://app.example.com. I have configured the .env file as follows: SESSION_DOMAIN=.example.com SANCTUM_STATEFUL_DOMAINS=https://app.example.com The axios configuration i ...

Determine unique dates from DateTime values in MySQL

I need to extract data from a database table that logs requests with an IP address column and a timestamp. My goal is to determine the number of days a specific IP address has made requests. I am currently using Laravel's query builder for this task. This ...

Viewing a list of indices instead of the usual application

I am relatively new to ReactJS and currently working on a project using Laravel alongside ReactJS. I have encountered an issue where instead of my web application displaying, the browser is showing a list of folders. Scenario: This occurs when I upload th ...

Eliminate a table row in Laravel by checking the input field's value is 0 with the help of jQuery

Looking to dynamically filter a table by removing rows with number fields containing a value of '0'. Is there a way to accomplish this using jQuery? <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></scri ...

Having trouble resolving the "start-container" issue when using Laravel with Sail?

When attempting to deploy my Laravel application using Docker with Laravel Sail, I created a docker-compose.yml file and Dockerfile as shown below. docker-compose.yml # For more information: https://laravel.com/docs/sail version: '3' services: laravel ...

Retrieving an AJAX array POST in Laravel 5 Controller

Below is the structure of my form: <td> <input type="text" name='name[]' class="form-control"/> </td> <td> <input type="text" name='mail[]' class="form-control"/> </td> <td> <select name="gender[]" class= ...

What steps can I take to pinpoint the error I made while running npm run build?

I am brand new to VueJS and this is my very first attempt at creating a single page application with a server-side app. I encountered an issue right before deploying the app on shared hosting. When I tried running "npm run build", it returned an error that ...

"Encountered error converting array to string while attempting to swap out two elements

Here is the code snippet I am working with: <?php $url_constructor = "http://myecommerce.dev/edit/article_name/article_id"; $cart_line_link = str_replace($url_constructor, array( 'article_id', 'article_name' ) , array( $ ...

What's the best way to search through various addresses for the source in an image tag?

In my current Laravel 5.8 project, I am faced with the task of searching through three different image sources for an img tag. First, I attempt to load the image from "". If that fails, I try a second URL like "". Should both attempts be unsuccessful, I th ...

Bootstrap has been successfully installed and is functioning properly; however, the custom styling does not seem to be

After successfully installing bootstrap and JavaScript through NPM in my Laravel 6 project, I have noticed that the bootstrap is functioning properly on my website. However, I encountered an issue when trying to add custom styles in the resources/sass/ap ...

Tips for modifying and removing the information within a card: Combining Laravel with vue.js

I've made some changes to my discussion forum setup by switching from displaying comments and replies in a traditional table format to using cards for a more visually appealing layout, like this: https://i.stack.imgur.com/vjIXN.jpg While the card display ...

Laravel - Jetstream with InertiaJS: Implementing guards in the main header menu of AppLayout.vue

Is there a way to utilize guards for adding a specific admin menu entry using guards? I am aware that passing guard-"data" from controllers to view is possible as mentioned in the documentation: class UsersController extends Controller { public functio ...

Laravel7 CORS issue: CORS policy blocks request due to access control check failure - missing 'Access-Control-Allow-Origin' header

Scenario: Integrating VueJS/Laravel app inventory with Magento2 using SOAP API to update Quantity. Error encountered: The following error occurred when trying to access '' from origin '' - CORS policy blocked the request: Th ...

When trying to authorize my channel, the JSON data is coming back as a blank string

I've encountered an issue with my JavaScript code: Pusher is throwing the error message "JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ", indicating empty data. I have double-checked the broadcasting service provider ...

"Within Laravel, the number of rows in a foreach loop may not always

@extends('layouts.app') @section('content') <h2>{{ $product->name }}</h2> <a href="{{action('VarietiesController@create')}}/{{$product->id}}"> Добавить новый вариант </a& ...

Laravel : How to utilize Eloquent to perform joins within a query

Within my database, I am working with five tables where I need to extract data from all of them: post, product, categories, attributes, post_attribute Currently, I have a query in my model that retrieves all posts for a particular product, including detai ...

The Ajax delete script is malfunctioning and not deleting records properly

I am currently facing an issue with my Ajax script for deleting entries. The script is working as intended, however, when I click the delete button, only the first entry in the list of all records gets deleted. Interestingly, upon refreshing the page, the ...

Error encountered: npm could not create a directory due to an unknown issue

After running the command npm install && npm run dev, I encountered an error message: npm ERR! code UNKNOWN npm ERR! syscall mkdir npm ERR! path C:\Users\user\AppData\Roaming\npm-cache\_cacache\content-v2\sha ...

How do you link a failing test to a reference when using $this->fail()?

Incorporating my custom assertion into Laravel's base TestCase class is something I'm working on. Here is a snippet of what it looks like: <?php namespace TestsMine; use TestsTestCase; class SomeTest extends TestCase { public function testSomet ...

Filter Laravel Eloquent relationship based on the latest pivot record

I have a scenario with 3 tables: user, role, and the pivot table named user_role. The user and role tables have a many-to-many relationship. In addition, every assignment (role to user) in the user_role table includes a timestamp, allowing me to determine ...

Running JavaScript in Laravel without explicitly calling it

I am facing a strange issue with my code. I have an input type="button" element along with a JavaScript function in the same page. The goal is to update a table column only when the user presses the button. However, the JavaScript function gets executed ev ...

"Incorporate multiple data entries into a table with the help of Jquery

How can I store multiple values in a table row using jQuery or JavaScript when the values come from a database via Ajax? <html> <head> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th ...

The results of executing DB::select function can vary from running a raw query directly in phpMyAdmin

I am facing an issue with my MariaDB query in Laravel as it is only returning 4 columns instead of the expected 7. Surprisingly, when I run the same query in PhpMyAdmin SQL editor, all 7 columns are returned correctly. I'm curious about why Laravel might ...

Ways to retrieve the two lowest prices from a column in a database using Laravel

I'm currently working on setting up an e-commerce website, and I'm creating a special "sale" section where I want to showcase two products with the lowest prices. While I know how to retrieve one product using the min() function, I am unsure abou ...

Creating a dynamic variable in Laravel 5.8 is quite simple. You can achieve this by using the "?" symbol as a

Here's an example of how to set parameters: For instance: http://localhost/firecek_web/pengaduan?barcode=8571385 Define the route: Route::get('/pengaduan','PengaduanController@index'); ...

Best practices for hosting multiple front-end applications using AngularJS along with a single back-end application with Laravel on a shared server

If I were to create an API using Laravel, exclusively for backend operations, with the domain being http://api.whatever.com Furthermore, my intention is to develop 2 distinct AngularJS front-end applications that will utilize this API - one for regular us ...

Unable to get Laravel route to work with parameters

In my route, there is an optional parameter. When I click on the link, it creates a problem. The URL looks like: http://localhost/my/public/admin/category/sub-create?2 However, it should look like this: http://localhost/my/public/admin/category/sub-crea ...

Laravel's BelongsTo Relationship: Attempting to Access a Property of an Undefined object

I am facing an issue while using BelongsTo to display customer details. Here is the code snippet I am currently working with: Controller Code: $assignees = assignee::latest() ->whereNull('timeout') ...

Trouble accessing Laravel route using Ajax technology

In my main container (app.blade.php), I have a home.blade file which contains a container that is refreshed with ajax when an item in the sidenav menu is clicked. If you click on one of those items after your session has expired, a middleware should redire ...

How come my image is not appearing on Vue.js when fetched from the API?

While working on my laravel vue project, I encountered an issue where the image is not being fetched from the backend API. All other data is being displayed correctly except for the image. JSON: [ { "id": 1, "name": ...

Can the items in the shopping cart be transferred from a guest to a logged-in

I implemented the shopping cart package from https://github.com/darryldecode/laravelshoppingcart Currently, my authentication system only requires a username without a password The issue I am facing relates to sessions As a guest user, the session code a ...

SQLSTATE[42S02]: The specified table or view cannot be found in the database: 1146 The table does not exist

Encountering an issue when trying to display data on the dashboard. I've established a relationship between a post and category table, assigned a category to the post, and attempted to call the category name from the category table on the dashboard, only t ...

Creating a text file and JSON in Laravel 4 framework: A step-by-step guide

Hey there! I have a simple question that I haven't been able to find an answer to. I'm looking to generate a .txt file using Laravel 4 and upload it to my server similar to how PHP does. Additionally, I need to create a JSON file with Laravel 4 ...

Utilizing Gulp with Laravel on an Ubuntu 16.04 Environment - A Comprehensive Guide

I'm facing an issue with gulp in my project. I have already installed node, npm, and gulp, and I've created a file named gulpfile.js. Whenever I try to use the command 'gulp', nothing seems to happen. I'm not sure what I'm d ...

Error encountered in Laravel API route: 'SymfonyComponentHttpKernelExceptionNotFoundHttpException' exception

As I work on creating a blog for my school project on my portfolio website, I am using VueJS and Laravel. To incorporate API routes into my project, it has become necessary. However, I encountered an issue when trying to delete a comment with a specific ID ...

Leverage the ghost property or function to generate custom outputs within a model

When creating custom output for a model, the method or ghost attribute can be used. For example, if the database has columns first_name and last_name and you want to access them as fullName in the view, which option is preferable? //Model public function ...

Vue.js | Web scrapers struggle to track v-for generated URLs

I am currently managing a small website that utilizes Laravel and Vue.js to display a list of items. You can check it out here. It seems like the Google crawler is having trouble following the links generated by the v-for function. In my Google Search Con ...

Help with Vue.js App Deployed on Heroku: How to Fix "Cannot GET /" Error?

When I try to access the URL for my Vue.js application (), it correctly takes me to the homepage. However, clicking on the 'Start' button, which should redirect me to '/test', gives me an error message saying 'Cannot GET /test'. I am uncertain about what ...

Once more, transfer a designated table in Laravel

I'm currently developing a Laravel application. I've made a small change to a database table which requires a fresh migration. Is there a way to only re-migrate that specific table in Laravel? ...

The error message "Required parameters are missing in Laravel" indicates that some essential

Hey there! I'm completely new to coding and recently started following a YouTube tutorial on setting up a simple server-side processing CRUD and DataTable in Laravel. However, I've encountered an error that I can't seem to figure out. I'm currently attemp ...

What is the most efficient way to retrieve a model object in Laravel without loading its related model object?

Currently, I am working on a Laravel project. Within my model 'Property,' I have a method called 'PropertyRatings' which looks like this: public function PropertyRatings() { return $this->hasMany('App\Models&bs ...

What is the best way to assign a variable using json_contains in Laravel without using any helper functions or

When I use (1), I am able to get the desired result from the laravel request. However, when I replace the hardcoded "fish" with a variable like $str = 'fish', I encounter syntax errors. (1) $find = animal::whereRaw('JSON_CONTAINS(animal_cat ...

Add the AJAX response to the dropdown menu options

Currently in my project, I am utilizing Laravel as a backend. The scenario is such that once the corresponding page loads, it triggers an ajax request to fetch vehicle data which consists of vehicle model and plate number properties. My aim is to display t ...

Webpack is stuck during the building process for the vue.common.js file

I recently set up a new Laravel application on my VPS and encountered an issue while trying to build it. The problem occurs when webpack attempts to build node_modules/vue/dist/vue.common.js as the process hangs. Here is the terminal output (project name ...

After implementing ajax jQuery with Laravel 10, this page is experiencing technical difficulties

Seeking assistance from experienced individuals in dealing with Ajax jQuery within the context of Laravel. I have encountered a problem that has proven difficult for me to resolve on my own. Sample html code: <li> <a href="" onclick ...

Is there a way to trigger a modal to open in VueJS with Bootstrap?

I have been attempting to trigger a modal in my Vue Template using bootstrap. However, I am encountering an issue where the modal does not appear when I use jQuery on it. Below is the code snippet: <template> <div id="app_religion"> ...

Implementing secure Laravel storage with Videojs and Vue.js

I am encountering an issue with accessing privately stored videos from my server using laravel, videojs, and vuejs. Below is the code snippet of my controller method: public function fetchPrivateVideo($video) { $video_path = '/private/courses/e ...

Leveraging Laravel's Eloquent with custom database views

I've encountered an issue with my database tables - specifically the expenses and incomes tables. To address this, I decided to create a MySQL view named transactions. This view essentially merges the two tables using a UNION operation and allows me to sel ...

Generate unique IDs in Laravel 6 or higher that consist only of numbers and also incorporate additional logic

Currently, I am generating a unique ID using the time() function which results in about 10 digits. However, I need to store an 18-digit number. To achieve this, I plan to generate random numbers of 3 digits, 3 digits, and 2 digits respectively. I have so ...

Leveraging Ajax for retrieving information from database in Laravel

Utilizing ajax to fetch data from the database and populate a select box. Upon selecting a group, it should display its contents accordingly. Encountering an issue when trying to showcase the form, as it reports Undefined variable: packages, even though t ...