Category : angular

The project uses: Backend: Laravel 8 for the API and Nodejs 16.10.0 for angular server side rendering. Front: Angular 12.01 Description of the problem: I’m using Apache for serving my Laravel API and Reverse-proxying the Nodejs server that returns the frontend. I use pm2 to start the node process. I do have another node process ..

Read more

I have used Angular-11 for frontend and Laravel-8 for backend in a project. When user signup, there will be notification to activate. Laravel: public function toMail($notifiable) { return (new MailMessage) ->subject(‘Confirm your account’) ->line(‘Thanks for signup! Please before you begin, you must confirm your account.’) ->action(‘Confirm Account’, url(‘https://myapp/auth/signup-activate?token=’.$notifiable->activation_token)) ->line(‘Thank you for using our application!’); } ..

Read more

I have a project on Angular-11 and Laravel-8 This is what I have: Laravel: env: APP_URL=https://api.myapp.com DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=hrms DB_USERNAME=myusername DB_PASSWORD=mypassword Angular: environment.ts: export const environment = { production: false, baseUrl: window.location.origin, // Base URL here apiUrl: ‘http://localhost:8888/myapp’, //your local API URL here }; environment.prod.ts: export const environment = { production: true, baseUrl: window.location.origin, ..

Read more

I need to turn my laravel api + angular sanctum authentication into a SAML authentication. I’ve noticed that I need to use a laravel plugin like laravel-saml2 or laravel-saml2. (Yes… Same name but different plugins) I intend to use OKTA because I am already using it to authenticate in my Stack ELK. But my biggest ..

Read more

I am using Angular–11 frontend d Laravel-8 backend for an application. I have this json error message that I developed from the backend: The custom error message is in this format: { "message": "User already exists", "error": true, "code": 500 } The angular signup.component.ts is like this: export class SignupComponent implements OnInit { form!: FormGroup; ..

Read more

public function handle(Request $request, Closure $next) { header(‘Access-Control-Allow-Origin : *’); header(‘Access-Control-Allow-Methods: GET, POST, DELETE, PATCH, PUT’ ); header(‘Access-Control-Allow-Headers : Content-type, X-Auth-Token, Authorization, Origin’); return $next($request); } i tried to post informations in Foms by angular but i got this error: Access to XMLHttpRequest at ‘http://localhost:8000/api/register’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: The ..

Read more

I am working on an Angular – Laravel Project, I have Login functionality, when i try to get to the login page, i get this error in the console : Console Error This is my login function in the Usercontroller : public function login(Request $request) { $validator = Validator::make($request->all(), [ "email" => "required|email", "password" => ..

Read more

I have implemented Laravel-Spatie-Permission on plain Laravel several times. But now I am using Angular-11 as the frontend and Laravel-8 as the backend. I have this code: authentication.service: @Injectable({ providedIn: ‘root’ }) export class AuthenticationService { currentUserSubject: BehaviorSubject<UserInterface | null> = new BehaviorSubject<UserInterface | null>(null); currentUser = this.currentUserSubject.asObservable(); localStorageUser = JSON.parse(String(localStorage.getItem(‘currentUser’))); sessionStorageUser = JSON.parse(String(sessionStorage.getItem(‘currentUser’))); isLoggedInSubject: ..

Read more

I have a Controller in my laravel project called Clientecontroller, it works perfectly. Inside it I have a method called listar() who brings me clients information. public function listar(Cliente $cliente){ $clientes = DB::table(‘clientes’) ->where(‘documento_id’, 1) ->first(); return $clientes; } Sure it have some troubles but my main question is, how I call this listar() function ..

Read more