Questions tagged [laravel]
The Laravel framework is an open-sourced PHP web framework that allows developers to create dynamic and scalable web applications. The source code of Laravel is hosted on GitHub and released under the MIT license.
191,838
questions
0
votes
0
answers
6
views
How to fix Laravel Postgresql group by issue?
I am using postgresql as database. I am constantly encountering the "Grouping Error" error that I want to count operations. I tried all kinds of methods, but somehow I could not overcome ...
0
votes
0
answers
5
views
Livewire checkbox filter to relation model
I have a Livewire component with search field whick works like a charm, and above that I have a list of Location model. /locations. Also, I have a relation table Categories with category_id. Now, i ...
0
votes
0
answers
4
views
Laravel sanctum token on different domains
I am currently using laravels default logging in functionality however the platform can be viewed on different domains e.g example.com testexample.com the second domain is pointing to the laravel ...
0
votes
0
answers
5
views
Word file to pdf converter in laravel without loosing formatting
How to convert the docx file to pdf without loosing the formatting, without any 3rd Party api.
I am using the DomPDF, but in dompdf i lose its format.
0
votes
0
answers
14
views
Why do I get 419 error on login made in api.php?
I've been researching for all internet why do I get this error when I try to POST on the login api route:
Status 419
unknown status
Version HTTP/1.1
Transferred 6.94 KB (6.46 KB size)
Referrer Policy ...
-3
votes
0
answers
13
views
How can i set a width to these columns
private function setupColumns()
{
$this->addColumn('Order', 'services_order',true, true, 'text-center order-id reorder column-multiorder ', true)
->addColumn('Service Name', '...
0
votes
2
answers
14
views
Laravel 8 - Illuminate\Auth\EloquentUserProvider::validateCredentials()
I have an application where I want to have authentication but not use User models. The model is called Karyawan. But when I change the auth.php it starts showing this error:
Illuminate\Auth\...
0
votes
0
answers
8
views
How to keep emails in sync in realtime with Laravel and IMAP? [closed]
I am using "webklex/laravel-imap": "^2.4" with Laravel v8.75. Currently, I am using a custom command to fetch all the data in emails using IMAP.
I need to keep the data in sync, in ...
-1
votes
0
answers
23
views
Display student users on teacher's dashboard
So basically I want to display the usertype (0) users on the teachers' dashboard. The retrival thing isn't working stuck on it.
UsersController.php
<?php
namespace App\Http\Controllers;
use ...
0
votes
1
answer
9
views
Why does cache:clear not wipe all Redis keys in Laravel?
I'm trying to figure out how the php artisan cache:clear command works in relation to my Redis data store. I can store keys in Redis and run cache:clear and the Redis keys are not wiped, even though I'...
0
votes
0
answers
10
views
How to fix Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'status') at app.js
I had the following code and everything was working as expected.
<template>
<div id="login">
<form @submit.prevent="submit">
<p class="loading&...
0
votes
0
answers
8
views
laravel9 window.livewire.emit is not being triggered
My issue,
I have a page with 2 lists, list ToDo and list Done when an item in list ToDo is dragged to list Done (I'm using jQueryUI draggable) i want to emit an event which updates the lists. However ...
-1
votes
1
answer
21
views
Undefined index error (but the indexes exist)
I have this to get some info from an API:
$postInformation = (new postInformation)->handle(['field' => 'slug', 'value' => $this->slug]);
$postId = $postInformation['id'];
Then I have ...
0
votes
1
answer
12
views
Vue, SPA, Laravel. Erro with response
I am getting an error when I request. Оn the backend side there is a check that the name length is at least 3 characters. The response from the server is correct. but when I try to display an error, ...
0
votes
0
answers
7
views
Not able to access REST APIs hosted on ubuntu VM from windows browsers
I'm working on windows 10 and installed ubuntu virtual machine on it. In ubuntu VM, Laravel REST API service is running on port 80. When my front-end application (on windows browser) tries to call/...
0
votes
1
answer
12
views
Laravel: Where does report() store the error messages?
According to the Laravel handling error documentation I've put this code snippet in one of my functions:
try {
// Send an email...
} catch (Throwable $e) {
report($e);
return false;
}
...
-2
votes
0
answers
20
views
run file pdf without popup download laravel
I launched the following code and it works fine. The file (http://127.0.0.1:8000/dl/file.pdf) opens as a download pop-up.
enter image description here
/routes/web.php
<?php
use Illuminate\Support\...
0
votes
0
answers
8
views
Dynamic laravel echo listeners
I'm using Laravel echo with Livewire like this.
protected function getListeners()
{
$listeners=[];
if($this->posts !== null)
foreach($this->posts as $post){
$listeners["...
0
votes
0
answers
22
views
Why does collapse not work In Laravel project?
I am working through some examples from the tailwind css page.
https://tailwind-elements.com/docs/standard/components/collapse/
https://tailwind-elements.com/docs/standard/navigation/sidenav/
(looking ...
0
votes
0
answers
13
views
Laravel eloquent join hides relationship (with)
I have the following problem: when I use join on an eloquent model, then the relationship model fetched by the with syntax will return empty.
User::with('partnerCommissions')->get(); //users ...
0
votes
2
answers
21
views
How to create a multi language website with Laravel 9
What is the best way to setup a multi language website with Laravel?
The URL must contain the language (nl, fr, en). For example: mywebsite.com/en/faq.
Most examples and tutorials I find use the ...
0
votes
1
answer
20
views
How to hide a publicity after user has realoded the page x times Laravel
On my website, on the index page, I have a bootstrap modal that shows publicities to the user when the page is loaded. I would like to hide this modal when the user would loaded the page more than 5 ...
-1
votes
0
answers
14
views
How to handle notification count when app is in background in firebase in web
I am receiving background notification, but I am not receiving any data in console.log, I don't know how to append html in background.
0
votes
0
answers
27
views
Laravel select a new custom raw on whereHas() with loading relation
I have a problem with relation filtering. I'm trying to filter the relation by immediately loading it and add a new field (distance_to_user) to the relation itself, filtering by it. But in the output ...
0
votes
0
answers
13
views
Laravel spatie custumize model_has_roles table
I changed model_has_roles table.I added domain_id in model_has_roles table there is no problem with that.
Now, I have one user with two domain. For instance, i have jhon doe in abc.com role with admin ...
0
votes
1
answer
9
views
multi auth using admin table inserting Credentials doesn't match
i am using multi guards one for admin and one for user
but when i log in and the information of ther user (email and password) is correct it returns Credentials doesn't match.
i don't know why ...
0
votes
0
answers
7
views
osiset / laravel-shopify - Authenticate user in Webhook
I am new to shopify app development. I want to make ADMIN API call in Laravel Jobs that is when webhook notification is triggered.
Here is the details of app flow:
Customer creates order in merchant ...
-1
votes
1
answer
45
views
1062 Duplicate entry 'General' - skip the insert if there is already a category with same name
I have a migration post_categories like this:
public function up()
{
Schema::create('post_categories', function (Blueprint $table) {
$table->id();
$...
0
votes
0
answers
19
views
Datepicker Enable Specific Days from list
I am trying to develop an appointment system. I tried to enable available dates in a date picker, but the problem is that it enables only one day.
$('#doctor').on('change', function() {
var drId ...
0
votes
0
answers
13
views
Dependent drop-down list maatwebsite laravel
I'm using maatwebsite-excel to create an excel file which will have some dependent dropdowns list. I wrote the below codes but it not working.
<?
use Maatwebsite\Excel\Events\AfterSheet;
use ...
0
votes
0
answers
12
views
Secure Laravel API with keycloak using socialite provider
im using Keycloak for an SSO to authenticate user that already exist in server (keycloak). I used Socialite provider and i can now authenticate user and access their token on Keycloak. But i want now ...
0
votes
0
answers
21
views
Problems to download excel-list Laravel 9
We have the opportunity to download results as an excel-file like this: https://imgur.com/w1g3tnB But this doesn't work here in Laravel 9.
This is how it looks in pdf: https://imgur.com/usjgBgw
I ...
0
votes
1
answer
27
views
how to count total replies and show them in descending order in Laravel
i have two table questions and replies. inside replies i am storing all the replies of the question so in my replies table i have field question id.
i want to count number of replies against the ...
-1
votes
2
answers
26
views
Eloquent formatting data with __get
I'm quite new to PHP / Eloquent in general and I'm trying to make a little data formatter in my Model class.
public function __get($key)
{
switch ($key) {
case "preferred":
...
-3
votes
0
answers
17
views
Validate the value based on status picked (Laravel)
I am trying to validate the values from my database. On my invoice model I am trying to find of the value if the user is completed, it will display on my dd. while if its not, it will show other ...
0
votes
1
answer
22
views
Store top categories from an API request into the database
I have an API request like this:
$postInformation =
(new postInformation)->handle(['field' => 'slug', 'value' => $this->slug]);
A dump of this response, besides other things, show some ...
0
votes
0
answers
19
views
Laravel 9: How to extend UrlGenerator core class
I'm trying to extend the UrlGenerator class in order to add a custom temporaryTenantSignedRoute and then use it like this :
Url::temporaryTenantSignedRoute(...)
So, I've created a class ...
0
votes
0
answers
30
views
Laravel Delete function not working using ajax
Hi im using datatable and need to delete multiple data using checkbox, I'm using post method javascript,
Controller
public function deleteselected(Request $request){
$ids = $request->ids;
...
0
votes
0
answers
21
views
base64 upload image not saving
in vuejs, i am sending base64 code and in laravel side, its decoding the base64 code. But table shows empty.
column datatype is text/longtext(i tried these).
I am getting base64 code in console.log.
...
0
votes
1
answer
22
views
How to use variables instead of column names for running new Migrations directly in the Controller
I'm using Laravel 8 and I wanted to run this code which insert two new columns, if the attribute name does not exist in the returned results of product_attr_info_correction column names.
$allAttrs ...
0
votes
0
answers
18
views
link custom domain (name.com) to Azure vm laravel & nginx [closed]
Good day, I have a Laravel application on an Azure Virtual machine using Nginx in the ubuntu VM.
I wanted to link it to the custom domain I purchased on name.com...
Those are the steps that I did so ...
0
votes
2
answers
33
views
Laravel Must be string when saving
I have a mounted variable and an error occurs when i'm about to save the variable.
public $code;
public function mount()
{
$this->code = substr(str_shuffle(str_repeat("...
-2
votes
0
answers
13
views
Best practice using react.js with Laravel [closed]
I'm starting to learn react.js and I've been working with vue. Vue.js is quite easy with Laravel because it has great support by Laravel. Now my question is which is best practice for React-Laravel ...
1
vote
1
answer
30
views
Problem with opening a view, Error 404, Not Found
So... The Error might be obvious but I cant find it. Im using Laravel 9.
The Error is '404 Not found'.
This is the Route
Route::get('/list', [ValidationController::class, 'index']);
This is the ...
0
votes
1
answer
11
views
laravel tenancy subdomain makes Auth in central database
I'm using stancl/tenancy library.
I have a central domain (example.com) and a tenant subdomain (tenant.example.com).
The problem is that the login in the tenant subdomain is trying to auth through ...
1
vote
1
answer
49
views
PHP: How to convert VARIANT DATE to datetime string
In my project, I get from external system date & time in VARIANT DATE type .
I need to convert it to datetime, i.e., 44768.25 => 2022-07-26 06:06:40.
Do you know how to do it in PHP? What is ...
0
votes
3
answers
21
views
laravel WhereHas by AVG
I want to return products that has average rating of 3 as example
->when($request['product_rating'], function ($query) use ($request) {
$query->wherehas('reviews', ...
-1
votes
2
answers
35
views
How to display a pop up notification laravel using ajax?
How to display a pop-up notification in admin side when a customer click an order?. Now its not getting the pop-up notification?.when inspect the values getting.
var ...
0
votes
0
answers
11
views
how can i pass parameter inside the then function and catch funtion of laravel Bus::batch
while passing the id in then function its value goes null but I want the inside then and catch function so I can update the response value to the mongo DB OR if it is possible to find the id of batch ...
0
votes
1
answer
35
views
Vuejs Display running balance
So I have a request that fetch the Billed and Payed and i want to make a table with running balance
this is my current fetched data
+--------------+------------+----------+
| Date Created | Billed ...