Category "laravel-9"

Laracel api resource Conditional Attributes not working, when processing Auth::check()

'likedPosts' => $this->when(Auth::check(), function () { return $this->likedPosts; }), When the current user is lo

How can i get the box id when querying a many to many relation in laravel?

I'm building a smart lockers building system and I'm just facing an issue that i don't really know how to solve. Let me explain, my db for this particular opera

Laravel chat app : Unable to deliver messages to a specific user

I have been trying to develop a chat app on Laravel with socket.io. Now, I am facing problem that is when a user is sending a message to a specific user, the me

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

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\

Laravel 9: Auth::user() / auth()->user() null after successfull login

I made a manual login system in a Laravel 9 API that it's works correctly, but when I try to use Auth::user() in another controller, I get it as null, but when

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 ne

Laravel 9 dynamic Email configurations

I am coming to you with a problem to which I couldn't find a solution on google after hours of googling. I want to be able to send emails by using different SMT

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

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

Laravel says application is in production but APP_ENV is local

My Laravel .env: APP_ENV=local APP_KEY=base64:7HjBWArUX989c8K87678687m2+6786876hs= APP_DEBUG=true APP_URL=http://localhost ... I get the following message if I

Getting an average rating of a TV show using average ratings of its seasons from ratings table (Laravel 9)

I have 3 tables: shows, seasons and ratings. I would like to get average ratings of specific seasons and then make an average of this for every show and sort th

How can I display an html text as a function in the blade?

I want to display the text in the blade as html. To do this, I used this code in the controller section: ‌ class MessageController{ public function cus

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

No alive nodes. All the 1 nodes seem to be down

I am trying to use Elasticsearch 8.1 using laravel. My elasticsearch instance is running at port 9200. https://localhost:9200 returns me { "name" : "node-1",

Laravel maintenance mode refresh and render parameter

I am trying to put my application into maintenance mode via php artisan down. php artisan down --refresh=5 works fine and my browser refreshes after 5 seconds I

Why new laravel 9 project with github shows "git: 'auth' is not a git command. See 'git --help'"?

I created a new project with laravel new testproj --github, in order to create a repository in github, but it keeps saying git: 'auth' is not a git command. See

Laravel 9 on PHP 8.1 slow responses - out of the box

I am using out of the box Laravel 9 / php 8.1 combo and loading initial page for 190ms sounds horrible. Last project I built used laravel7 and the response time

Bind Livewire component to parent array

I have the following structure: A parent component: class SiteEditComponent extends Component { protected $listeners = ['upClicked', 'downClicked', 'childU

Laravel 9 Cannot find table - pivot table singular/plural issue

My understanding is that the naming convention for database tables in Laravel is to use plural names for regular tables, and singular names for pivot tables (do