Deploy your node application using netlfiy functions
AWS’s serverless Lambda functions open a world of possibilities for running on-demand, server-side code without having to run a dedicated server.
Netlify lets you deploy serverless Lambda functions without an AWS account, and with function management handled directly within Netlify. Your serverless functions are version-controlled, built, and deployed along with the rest of your Netlify site, and we will automatically handle service discovery through our built-in API gateway. This eliminates overhead and brings the power of Deploy Previews and rollbacks to your serverless functions.
We will run through how to deploy a ‘Hello…
Laravel 8 has removed default auth scaffolding and simply provides a composer package for creating auth scaffold in a Laravel application. This article will show how to get a basic authentication system up and running with the laravel/ui package.
composer create-project --prefer-dist laravel/laravel laravel_demo
For more detailed installation instructions, visit the documentation.
You can set up a database like mysql by modifying the
DB_USERNAME=db user name
Or you can set up sqlite:
database.sqlitein this folder as
.envfile like this:
Writing tests is always important to maintain the quality of your codebase. Most Laravel APIs will have authenticated routes, which only logged-in users can access or users with certain roles etc. To write tests for these routes you will need to mock logins in your test. I will show how you can achieve this with minimal fuss.
You need to sign in a different user for each test, so before each request, you send you could create a user and sign them in, but it will get very repetitive if you have any more than a few tests in your…
Thanks to the Storage Facade in Laravel, interacting with files is now a lot more straightforward. In past implementations of file upload, I sent the file to the same server as my Laravel API, in order to upload it to S3. That worked out ok, you can upload the file like this:
$file->storeAs($basePath, $uuid . '.' . $file->extension(), 's3');
This worked quite well for small files — I just kept a database table of
file_uploads to store where each file was now located within S3.
Now I have a new situation where the file is coming from another server, and…
Tailwindcss is a utility-first CSS framework that can be composed to build any design, directly in your markup.
This is a quick tutorial to show how tailwind can be configured in a fresh React application using create react app.
Create a new react application:
npx create-react-app tailwind-demo
When I run
yarn start and visit the default url
localhost:3000 I can see the familiar React page:
How pet microchipping works
At MyPet, we believe that getting your pet microchipped is the best way of making sure you’re reunited if they get lost or stolen. All pets should be microchipped — a collar or tag can fall off or be removed, but a microchip is a more permanent way to identify your pet and keep them safe.
I have an application which has a table of users and a new requirement that these users have an incrementing identifier applied both for new users and existing users. I want to show how to achieve the database migration that needs to be written to retrospectively apply this identifier to existing users in the order that the users were created.
I want to add a unique identifier to my table which counts a user’s ‘number’ within a team retrospectively.
identifier column is the new column and I’d like to add. The first user in each…
More and more companies are beginning to use Webhook technology in software integration, while interest in webhooks has grown considerably over the past 10 years according to Google Trends:
Generate a “Hello world” larvel package in record time!
Packages are the primary way of adding functionality to Laravel. This article will get you up and running quickly with a basic package.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage them for you. For this tutorial you will need to have composer installed as a prerequisite. You can download composer here.
Create a new laravel project:
composer create-project — prefer-dist laravel/laravel documentrcd documentr
Open the project in your IDE.
The first thing to…
Improve tests for your laravel application
PHPUnit is a unit testing framework for the PHP programming language. Laravel has support for PHPUnit included out of the box, and a
phpunit.xml file is already set up for your application.
In your project your
tests directory will contain 2 directories:
Unit. Unit tests are tests that focus on a very small, isolated portion of your code. In fact, most unit tests probably focus on a single method. …