Questions tagged [laravel-8]

Giving wings to web development, Laravel 8 emerges as the latest evolution of the renowned PHP framework pioneered by Taylor Otwell. Unleashed unto the digital realm on September 8, 2020, it showcases its prowess in orchestrating seamless web experiences. Feel free to explore its limitless potential and share your inquiries under the enlightening [laravel] tag.

What is the best way to implement dynamic generation of Form::date() in Laravel 8?

Is there a way to dynamically generate the Form::date() based on the selection of 1? If 1 is selected, then display the Form::date() under the Form::select(). However, if 0 is selected, then hide the Form::date() in this particular view. For example: Sel ...

Sending a Content-Length header with a file response in Laravel is not supported

I am currently attempting to include the Content-Length header in my file response in order to display a progress bar on the client side. I am using this method: return response()->header('Content-Length', $fileSize)->file($this->filesPa ...

The authentication system in my Laravel 8 application runs smoothly on XAMPP Local Server, but encounters issues when deployed on cPanel. Instead of successfully authenticating users, it displays a "Page Expired"

After successfully developing an application with Laravel and implementing Laravel Auth for authentication, everything worked perfectly on my local server. However, when I decided to host the application online, I encountered a major issue. Despite input ...

Set up global variables for components to access

Currently, I am working on a Laravel 8 project with vue-sweetalert2 integration. My goal is to set up the Toast behavior once and then be able to call it within various components. At the moment, my code looks like this: /js/components/Mypage.vue <scr ...

Tips for successfully sending various link values through a URL using Ajax

Within the Laravel framework, I am developing a system where users can input criteria and retrieve data from the database that matches their search criteria. In the resulting table, there is a link labeled "request" in each row of data. When a user clicks ...

Issue encountered with Spatie/Browsershot in Laravel: npm and node were not located

After installing Spatie/Browsershot using composer, I encountered an error that seems beyond my expertise. Can anyone provide assistance? use SpatieBrowsershotBrowsershot; Browsershot::html('testing')->save('/public/assets/pdfs/example.pdf'); The ...

Dividing an array in Laravel according to the key value

Hey everyone, I'm currently working on a Laravel project where users need to submit data with files on a specific page. When the user clicks submit, multiple forms will be submitted at once. To achieve this, I am using formData to separate the files and ot ...

What is the process for developing an Android App using a VueJs SPA implemented within Laravel?

I have successfully implemented VueJS in Laravel for Frontend Development. I am now curious if the same VueJs frontend code can be utilized to develop an Android App. If so, what are the necessary steps? I am inexperienced with using Native in Laravel Vue ...

Laravel - Creating custom middleware for typed Request parameters

I am looking to utilize the VacancyListRequest in order to pass middleware parameters and validate them using its rules before reaching the controller action. While I understand that middleware follows the Pipeline pattern, I am unsure how to use a custom ...

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 ...

Having trouble transmitting integer data from Vue to Laravel through FormData?

While successfully updating a database using Vue 2 to a Laravel 8 Controller with Axios, I encountered a challenge when trying to pass an integer value to my database. The 'number_of_searches' column in my database must be stored as an integer. The Larave ...

Obtaining the AI id in Laravel controller prior to saving: Best practices

I've been attempting to retrieve the auto increment ID from the booking table before saving new data, but I keep encountering errors. Here is the snippet of code in the controller: public function addAppointment(Request $request) { $user = auth() ...

What is the process of creating and verifying a Laravel random and temporary password?

I am seeking assistance in implementing a function that can generate an unpredictable password and subsequently verify if the user is utilizing the previously generated password. Your help and guidance are highly valued. Thank you sincerely! ...

Styling Easy-Autocomplete with jQuery

I am currently working on integrating autocomplete functionality using the jquery easy-autocomplete plugin npm install --save easy-autocomplete I am facing two issues related to its styling. The results are being displayed in a bulleted list format. I ...

I am facing an issue where the data is not displaying as expected in the console

Having trouble with my Vue app where I have two methods - one to retrieve data from my Laravel backend and the other to use that data. The issue is that the second method is not able to grab the data. Below is a sample of my code: <template> ...

"CachePathException" Ensure a proper cache path is provided in Laravel 8

Upon returning to a project after a week without making any changes, my php artisan command suddenly stopped working. Strangely, this issue only affects this specific project, as other projects are running fine with php artisan. When attempting to execute ...

Using Laravel: accessing parent controller methods in a view

In my setup, I have a main controller named Controller.php that loads various classes. Additionally, I have another controller called Admin.php which extends from the main controller, allowing it to access methods from the loaded classes such as the sessio ...

Tips for creating a cURL request with basic authentication in Laravel version 8

I am working with the PayPal Payout SDK and using the code below to obtain access tokens from the PayPal API. curl -v POST https://api-m.sandbox.paypal.com/v1/oauth2/token \ -H "Accept: application/json" \ -H "Accept-Language: ...

The constructor of App\Events\ChatEvent requires its first argument ($data) to be an array, but a string was provided instead

This is the Event: public $data = []; public function __construct(array $data) { $this->data = $data; } Once a value is passed to the event: public function saveMessage(Request $request) { $messageData = [ "to_user_id" =& ...

Setting up a Cron Job in cPanel to Automate Task Scheduling in Laravel

Just like the title suggests, I followed the documentation to set up a cron job but it's not working. There are no updates in the laravel.log file either, which could have provided some insight. Here is how I configured my cron job: https://i.stack.i ...

Storing data from a form into a pivot table in Laravel requires a few steps. Here's how

I am currently working on storing data from a form to a pivot table called asset_user. User Model: public function assets() { return $this->belongsToMany(Asset::class)->withPivot(['amount']); } Asset Model: public function users() { return ...

Utilizing Laravel Eloquent to perform substring queries in SQL

Struggling with my SQL query in Laravel 8. I'm aiming to extract the first character from the column name, but only for distinct values. These characters will be linked to glossary definitions. $chars = DB::table('parts') ->distinct() ...

Discover the step-by-step process of retrieving an image through jQuery AJAX in Laravel 8

I'm facing an issue while trying to download images using jQuery/AJAX in Laravel 8. Although I am able to retrieve the image in the response, it isn't downloading as expected. Could someone please assist me in resolving this problem? Controller ...

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) { ...

How to send dynamic values to a computed function in Vue.js

Trying to pass an id with the v-model in order to dynamically filter a table without hardcoding names into the function. The goal is for the function to be able to filter both select boxes. The data is referred to as guides, containing attributes such as ...

Leveraging the orWhere clause in Eloquent

I have two tables: courriers(courrier_id, repondre ..) and reponses(reponse_id, structure, courrier_id) connected through a one-to-many relationship (where 1 courrier can have several reponses). I am looking to retrieve the courriers where courriers.repond ...