Questions tagged laravel

Explore the latest questions and answers asked by our top developers.

How to handle a blog post content in Angular?

I’m implementing an Angular app with Laravel REST API as the backend. I want the app to have a feature of a microblog. I am planning to store formatted text with html tags (like <ul> or <b>) as TEXT field (MySQL database) Let’s say I’m sending a blog post of 64 000 characters to my […]

By greenbanzai
Categorized as angular, blogs, laravel, rest, typescript Tagged , , , ,

"Unexpected token < in JSON at position 0" – Angular and Laravel

I have a Angular Frontend and Laravel Backend with authentication (jwt/bearer) and local is everything fine and even when I try the Laravel Backend API in production with Postman, everything works like expected. When I try to register or to login via frontend in production, I always get "Unexpected token < in JSON at position […]

By Philipp
Categorized as angular, json, laravel Tagged , ,

Laravel 8 CORS issue, 504 Gateway Timeout (from service worker)

I am developing an API using the latest Laravel v8.65 framework and is hosted on the domain lets say and the front end has been developed using the Angular framework v13.x and is hosted on Both the sites has SSL certificates installed. When the Laravel API is tested from Postman, it works fine! […]

By Dipendra Gurung
Categorized as angular, laravel, laravel-8 Tagged , ,

Laravel Sanctum with Angular SPA on same TLD issues with XSRF-TOKEN

The Angular app does not always set the XSRF-TOKEN when making POST request to the Laravel server. The issue is that I know how to make the app not work I just can not figure out how to make it work properly without tricking it. Angular is running on Laravel is running on […]

Laravel Api returning 301 status to angular frontend

My laravel app is serving my angular app properly on localhost when served with php artisan serve. However after commiting my changes to a DO droplet running apache, Chrome gets a 301 cors problem. Whats wrong Source: Angular Questions

By Noble Eugene
Categorized as angular, cors, http, laravel Tagged , , ,

Handling token expired in Laravel JWT

I’m using tymondesigns/jwt-auth in Laravel and angular application, this is the code i’m using i’m getting token expired error from laravel end in my network tab when idle time is more than 20-30 min but my ttl value is 1440, and front end user should get message in popup that their session expire rather than […]

By user3653474
Categorized as angular, laravel, laravel-5, laravel-7 Tagged , , ,

How to edit and update an mysql database table cell value from angularjs

Iam begginer to learn about laravel 8 and angualarjs,im try to make crud with angularjs. i need to edit and delete inthisform enter image description here Source: AngularJS Questions

By bass
Categorized as angularjs, laravel, laravel-8 Tagged , ,

Fetch and display table data in angular and laravel

I’m trying to display data fetched from laravel api in angular table code is : public function fetchQuestions(Request $request) { $questions = Questions::where(‘status’,$request->status)->get(); return response()->json($questions, 200); } angular code: questions = []; …’api/auth/question’, formData).subscribe(result => { this.questions.push(result); This does not display any data i have to use this.questions.push(result[0]); this.questions.push(result[1]); .. .. this.questions.push(result[n]); to push […]

By user3653474
Categorized as angular, laravel, laravel-5 Tagged , ,

Sending file from Angular to Laravel

I’m sending an image file from Angular 13.0.4 to my Laravel 8 controller, but this file is not recognized by Laravel. It’s like not sending anything. When I try Postman or Insomnia it works perfectly fine. My Laravel Controller is like this: public function uploadimage(Request $request) { if ($request->hasFile(‘image’)) { return response()->json(["message" => "A file […]

By Rijad Morina
Categorized as angular, laravel, laravel-8 Tagged , ,

securing laravel api in angular

I have this auth.interceptor.ts import { Injectable } from "@angular/core"; import { HttpInterceptor, HttpRequest, HttpHandler } from "@angular/common/http"; import { TokenService } from "../shared/token.service"; @Injectable() export class AuthInterceptor implements HttpInterceptor { constructor(private tokenService: TokenService) { } intercept(req: HttpRequest<any>, next: HttpHandler) { const accessToken = this.tokenService.getToken(); req = req.clone({ setHeaders: { Authorization: "Bearer " + accessToken […]

By user3653474
Categorized as angular, laravel Tagged ,
1 2 3 29

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us