Lifetime access is $100 off. Available for a limited time.Join here →
Snippets

Cleanly Setting Axios Base URL

Playing
Cleanly Setting Axios Base URL
6 mins4 years ago

Two methods for setting Axios' base URL in your projects instead of using it directly from config.

Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Comments

No comments, yet. Be the first to leave a comment.

Suggested courses

Build a URL Shortener with Volt and Folio

Volt is a functional API for Livewire that allows you to build Livewire components in a single file, alongside Blade templates. Pairing this with automatic route creation using Laravel Folio gives us a serious productivity boost. So, let’s build a URL shortener while learning how Volt and Folio work!

10 episodes
53 mins

Authentication with Laravel Sanctum and Vue

Learn how to authenticate with a Laravel API from Vue using the Composition API. We'll start by setting up a fresh Laravel project with Sanctum and Fortify, configure everything step-by-step, and then implement the ability to authenticate from Vue with a simple auth module — thanks to the flexibility of the Composition API. In the second half of the course, we’ll create our own beautiful starter kit with more features, including registration and middleware to protect routes.

0 episodes
0 mins

Build a Pay Once For Access App

Let's do payments right with the Stripe Payment Intent API, and build an app where customers can pay to access a members area. We'll cover setting up a Payment Intent, process payments correctly with authorization, handle declines, and securely respond to a Stripe webhook to upgrade a member. This course is for you if: - You want to process payments to upgrade customers for access - You need to learn how to properly process one-off payments with Stripe - You need a refresher on the Payment Intents API

15 episodes
1 hr 11 mins

Build a Referral System with Laravel

Let's build a feature complete Laravel referral system, completely from scratch. We’ll cover generating referral codes, setting a cookie to track the referral process, hooking up referrals to subscriptions and displaying detailed referral stats in a dashboard, so your users can see how they're doing. On the admin side, we'll set up a job to automatically generate a CSV with all the amounts you need to pay out each month, automatically mark referrals as paid, and display historical referral payments for users.

24 episodes
2 hrs 39 mins

reCAPTCHA with Laravel

Adding Google reCAPTCHA to a Laravel form isn’t too much trouble, but what happens when we want to re-use it for other forms? This course focuses on setting up reCAPTCHA using Alpine.js to fetch the token, and then middleware to verify the token based on a threshold in our config. We’ll add a Blade directive too, so we’re able to easily use reCAPTCHA for any forms in our Laravel apps — just by adding a couple of lines of code.

8 episodes
49 mins