skip to Main Content

Attempt to read property "id" on bool in Laravel 8

I got this data from an external API call. $countries = @file_get_contents('https://external../api/countries'); $countriesArray = json_decode($countries, true); print_r($countriesArray); //dd($countriesArray); Array ( [success] => 1 [message] => countries [data] => Array ( [0] => Array ( [id] => 1 [name] => Afghanistan…

VIEW QUESTION

This password does not use the Bcrypt algorithm on laravel 10

public function login(Request $request) { // Validate the request $request->validate([ 'username' => 'required|string', 'password' => 'required|string', ]); // Attempt to find the user by username $user = User::where('username', $request->username)->first(); // Check if the user exists if (!$user) { return response()->json(['error'…

VIEW QUESTION

Laravel – PostMan Unauthorized 401

I'm having an issue when trying to register a new user in my Laravel application that uses Passport for API authentication. Here's the scenario and the error I'm facing: Scenario: I'm developing a RESTful API with Laravel and using Passport…

VIEW QUESTION
Back To Top
Search