Questions tagged [laravel-9]
Laravel 9 is the current stable version of the open-source PHP web framework created by Taylor Otwell. It was released on February 8, 2022. Please use the [laravel] tag for general Laravel-related questions.
308
questions
1
vote
0
answers
9
views
Is there a way to install laravel 9 on your machine with out having php 8 on your machine?
I tried creating larvel 9 project using composer. Since my machine don't have php 8 installed on it. While running command composer create-project laravel/laravel --prefer-dist myapp, a laravel 8 ...
0
votes
1
answer
22
views
why giving Axios error-404 in react and laravel api
I am trying to submit data from a form on my page to a react.js api using axios but i get the following error.
import axios from 'axios';
import React, { Component } from 'react'
import { Link } ...
0
votes
1
answer
28
views
limit the view depending on the values - Laravel - Spatie
I need, depending on the role/permission of each user, to limit the database records that are displayed in the view index.
For example, I need a certain user to only be able to see the records with ...
-1
votes
1
answer
16
views
Laravel 9/Passport not working in production
I just deployed a Laravel 9 Passport based API to Digital Ocean. Everything works fine, but when I try lo log an user or an admin and create a token to be stored and returned, I get 500 server error.
...
1
vote
1
answer
20
views
Laravel query showing different Result in DB::Table and DB::Select with inner join
I'm using 3 table
1.organizations
2.users
3.organization_user
So the organization_user is the pivot table for getting org. and user.
DB::select("SELECT users.name 'User Name',organizations.name '...
0
votes
2
answers
37
views
Would like a php version of php 8.1 for a specific virtual website
I have a virtual website in an ubuntu 18.04 server that is written in Laravel9 and it needs php version 8.0.2 or higher. The error looks like this in the browser:
Composer detected issues in your ...
0
votes
3
answers
42
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
0
answers
29
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 ...
-2
votes
1
answer
32
views
I can't concatenate correctly to the source of the image
I have the following problem: I cannot concatenate correctly, so that my image is sent from the form. the rest of the fields work without problems
<h1><strong>Fecha IP:</strong>{{$...
0
votes
1
answer
20
views
Laravel 9 Breeze api Authenticate with different user types
How can I check the user type in LoginRequest of laravel breeze?
I am implementing Laravel breeze with next.js for my backend. The logic is that the admin login to the dashboard using the next.js ...
0
votes
0
answers
15
views
Explain this with example
HP@LAPTOP-ASEAM8KR MINGW64 ~/Desktop/udemy_laravel/blog
$ php artisan tinker
Psy Shell v0.11.2 (PHP 8.1.4 — cli) by Justin Hileman
$posts = App\Models\Post::create([ 'user_id'=> 0, 'title'=>&...
0
votes
0
answers
16
views
The Composer installer script did not run correctly [exit code 259] and no output was returned
Hey guys i just got a new device so i tried installing composer on it, so i downloaded it from getcomposer.org
and i tried installing but then after clicking next on the ready to install page, it took ...
0
votes
0
answers
21
views
How to enforcing Laravel to render view components on a string?
I have this string:
<div class="my-card-container">
<x-card :title="Hello Wordl"></x-card>
</div>
This string is coming from database, it lives in the ...
0
votes
2
answers
84
views
+50
Laravel 9 - Passport custom api for Authorization
In my application, I am using Passport for Authentication. I have created a Password grant client for generating access tokens for our mobile and web app.
Now I have to add a third-party client that ...
0
votes
1
answer
29
views
Can't send mail with Lumen framework and no error appears
Since yesterday I have had problems sending emails with Lumen. I think I have followed all the steps in the documentation correctly, but unfortunately I cannot send anything. Moreover, no error is ...
-3
votes
1
answer
36
views
In Laravel 9, how to insert data into a database [closed]
I am working with Laravel 9. I am trying to insert data into database. It is not user data, data will be inserted into database on form submit button.
My view:
<form action="{{ route('...
0
votes
1
answer
31
views
Problem at startup laravel9 system after git clone
After I made a git clone with my project, composer install and everything and php artisan serve I'm just getting three lines of footers like this: 2022 © Webshooter LM AB | Du använder version 4.1.9 | ...
0
votes
1
answer
2k
views
How to fix a Laravel Sail "SQLSTATE[HY000] [1130] Host 'XXX.XXX.X.X' is not allowed to connect to this MySQL server" error
Laravel: 9.2
Mac OS: 12.3.1
Docker Desktop: 4.5.0
I have installed a default Laravel project using sail. My docker-compose.yml file includes the following:
mysql:
image: 'mysql/mysql-server:8....
0
votes
0
answers
25
views
Laravel Eloquent for count not working properly
In my Laravel application, I'm trying to display a count with a chart on my view where my employee status is a subcontractor.
In my user's table, I have a column called is_subcontractor, and if the ...
-1
votes
0
answers
29
views
syntax error, unexpected identifier Laravel Enum 9.12 [closed]
I'm working on a Project trying using "enums" on Laravel 9 and its give me this error
"syntax error, unexpected identifier"
error image
Using Laravel v9.12.2
PHP 8.0.7 (cli) (built:...
0
votes
0
answers
14
views
Laravel 9 Composer Require Failed = Your requirements could not be resolved to an installable set of packages
I apologize in advance because I have created a thread with a similar title to another thread. I had to do this because I couldn't find a way to fix this.
So, I want to make my website auto reload/...
-1
votes
0
answers
13
views
How do I fetch product details and display to table when i click on product image without refreshing page
I am trying to create a mini POS project, I want when i click on the images on the right side, then I have to add that product details from database to this table without refreshing that page. the one ...
0
votes
0
answers
9
views
Laravel 9 api error while trying to get current user from request
I am building a blog and I wanted to validate the user that is creating a blog by getting the user data from the request ie, id, name, role, and other stuff then validate if they have the correct role ...
0
votes
0
answers
32
views
Failed to execute 'replaceState' on 'History': #<Object> could not be cloned
I have this Jetstream Laravel application, which has a presence channel set up for chat features.
What's happening is:
When I join the channel and send a message there, everything works fine, except ...
0
votes
0
answers
31
views
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The POST method is not supported for this route. Supported methods
api.phpweb.phpreactjs/register.js
Data is not being sent to the database. I am getting 500 server error
0
votes
0
answers
14
views
how do I render out of livewire folder in laravel
is it possible to render out of folder ie
change to
public function render()
{
return view('community.community',['email'=>$this->email]);
}
from
public function render()
{
...
-1
votes
2
answers
58
views
How to dynamically define the subject of emails in mailable - Laravel
Here is the piece of code. My idea is that each email comes out with one of the values/entry from one of my tables.
public function __construct($siniestro)
{
$this->...
0
votes
2
answers
67
views
How to show inertia data to Vue Componets?
In Vue Inspector I'm actually getting the message, But I'm not sure how to use it on Vue Components.
Please check out the image link
https://ibb.co/2KTmstS
I'm using Inertia helper method and sending ...
1
vote
0
answers
32
views
Laravel Nova 4 customize layout
Since Nova 4 has no blades anymore that you could publish, how could you approach customization the best in for example the head navbar next to the searchbar? I'd like to add a drop-down there but I ...
0
votes
1
answer
34
views
Difference between @aware and @props directives in laravel 9
The @aware Laravel Blade template directive was introduced in Laravel 8, but I still don't understand what it does differently from the already existing @props directive.
For instance, if I use a ...
0
votes
1
answer
46
views
How to get query log of events run by admins
I want to get all the queries that run by each Admin of my website.
I mean I need to get the url of the page that they're running query and also their user id and ip address.
But for doing this, I don'...
0
votes
0
answers
10
views
Edujugon push notification Laravel 9
composer require edujugon/push-notification is not installable in laravel 9.
my composer.json is as below
"require": {
"php": "^7.3|^8.0.0",
"...
0
votes
2
answers
59
views
How to print route lists in Blade
I wonder is it possible to print all route lists in a Blade, just like the way we see them in terminal after typing php artisan route:list
So in that case we just need a table with these headers:
...
0
votes
1
answer
26
views
Laravel routes not working normally in custom files of routes
I use custom routes files in laravel 9 and I countered this problem:
The route return me to the home page when using route function in the link but it's work when I use url function, and the routes ...
0
votes
0
answers
25
views
redirect from the controller, depending on the role, to different views
This is the error I have
screenshot error
Here I attach the code in my controller
$siniestro->update($request->all());
function authenticated(Request $request, $user) {
if ($...
-1
votes
0
answers
35
views
I cant login or Register on my Laravel app
Good evening everyone, I am working on this new laravel application and I have not been able to register nor log in i keep getting this error message.
^ "Undefined array key "App\Models\User&...
-2
votes
2
answers
81
views
Enters the if statement where it shouldn't php Laravel9
Ok, here is the whole function stripped by not needed info:
$signups = $query->get(); COMMENT Here is it getting data
if($signups):
dump($signups); ...
0
votes
2
answers
50
views
Laravel - Is it possible to validate a get wildcard Request with Illuminate\Foundation\Http\FormRequest;
I have a GET route with a wildcard day.
This day wildcard is a string like so: 20220507 (YYYYMMDD).
After validation the string I wish to make a proper response. Before sending the response I want to ...
0
votes
2
answers
44
views
Return json response in ajax request laravel
I have the following ajax code in my frontend.
var formData = $('#application-information-step-one').serialize();
var actionUrl = $('#application-information-step-one').attr('action');
$.ajax({
...
-1
votes
0
answers
37
views
How to check authorization before loading Route Model Binding
I ask this question after doing various searches without finding any clarifying information that helps me solve the problem that I am presenting.
I have created a controller with the following command:...
1
vote
2
answers
34
views
How To Access A Column In M-M Relationship Table In Laravel
I made a many-to-many relationship in laravel, where users can make announcements on an event.
The problem is that I want to retrieve the announcement message from the database using the relationship.
...
0
votes
1
answer
30
views
Problems in Laravel when logging in
I am uploading my first Laravel application to a hosting, and after creating a user, I get the following error:
screenshot from error
I am seeing that the registration of the new user was created ...
0
votes
1
answer
36
views
Laravel Connection refused with different host name
I am using a Laravel 9 installation that is running perfectly on localhost.
When I add 127.0.0.1 myapp.local to my /etc/hosts (MacOS), I get a
SQLSTATE[HY000] [2002] Connection refused
I am using ...
0
votes
0
answers
18
views
Can't reach css files laravel-9
I am building a website. in index page everything works. But I tried to add page. At service page, I can reach the content but it is unstyled.
My index file starts like this
@extends('layouts....
0
votes
2
answers
40
views
Laravel route returning error 404 when attempt is made to pass value to controller function
I have a button in my blade like this
@can('customer_show')
<a class = "btn btn-primary" href = "{{ route('admin.loan-applications.showCustView', $loanApplication->...
0
votes
0
answers
24
views
Deleted_by is not changing while i delete a data using observers;
I want to have fields created_by,updated_by and deleted_by and want to update these fields automatically. created_by,updated_by is working but deleted_by is not working.i am using an observer to ...
0
votes
1
answer
38
views
Deleted_by is not changing while i delete a data;
I want to have fields created_by,updated_by and deleted_by and want to update these fields automatically. created_by,updated_by is working but deleted_by is not working.
in my model
use SoftDeletes;
...
0
votes
0
answers
13
views
Laravel collection not saving added data
I'm building a Laravel 9x application where i will need to populate some pages with the google places API.
Reading at the ToS of Google Places, i can only store in my db, for at most 30 days, the ...
0
votes
1
answer
40
views
Show page numbers as navigation in Laravel pagination
I ma using Laravel 9 and it renders previous,next button for pagination. How could I change it to page numbers.
It shows :
< Previous , Next >
What I want is:
< 1 2 3 4 >
In controller I ...
0
votes
1
answer
21
views
Laravel custom validation rule mock in a test case
I have created a custom form request and it has this kind of a custom rule
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ExampleUserRequest extends FormRequest
{
...