Populate database table with Laravel Faker from pre-populated table

I want to populate a table with listings of car offers with dummy data. The specific is that I want the make and model to be from a table already created in the database. Also the listing’s title to …

Failed login attempts via nginx/laravel API calls

I was dealing with an issue where my API site was not accessible either by my iOS app or by a web client. I fixed the issue and can now visit the API site via web client, but now am unable to login to …

How to optimize an increment query in Laravel?

in a Laravel project I am incrementing views based on session I am using it like this: $post = Post::whereSlug($slug)->firstOrFail(); $postKey = ‘post_’.$post->id; if (!Session::has($postKey)) …

Undefined variable $services

I have this error. I did this a couple of times on a different pages with different subjects , but with the same method. It always worked. But for some reason now I’m getting this error. Undefined …

how to get all user based on where condition and compare this result with another condition in laravel eloquent

I have a user table column referred_by: I have a view for step 1 user like where referred_by=auth::user()->id In here whoever registered by this user referal link will be shown in this table: I …

Error Message: “The GET method is not supported for this route. Supported methods: POST”

when i access to endpoint this http://localhost/newsapp_api/public/api/register,this message is showed “The GET method is not supported for this route. Supported methods: POST”. look to the …

Can’t get a list of streets to create a card [closed]

public function create() { $streets = street::get(); return view(‘dashboard.house.created’); } public function store(Request $request) { $this->validate($request, [ …

How to pass variable to markdown? laravel mail

I am using MailMessage to send a mail message to mailtrap, and I pass a variable email. My problem it doesn’t recognize the variable that I pass in the markdown. It returns an error below Facade…

PHP BCMath cannot handle the exponential number if it is passed to its function, PHP BCMath return “ bcmath function argument is not well-formed”

I working on the few of the small decimals like 0.0000687, 0.0000063241, 0.0000454. I used BCMath as to get the most precise result because it involved with money calculation, so far BCMath it is very …

How to get instance of a collection in Laravel 8 to use in a if statement?

How to get instance of a collection in Laravel 8? I want to make a if statement if $event->like (CODE BELOW) does not exists for that specific event and an else statement I want to execute the …