Skip to content

Latest commit

 

History

History

laravel-authenticated-todo-list

Laravel - S.S.A Todo-List

🔒 Authenticated Todo-List

Build with:

With libSQL Native Extension / Turso Client PHP for PHP install and configured in PHP Environment.

🚨 The Extension is Required 🚨

Download

Download the latest build extension/driver binary you can see at Release page. It's available for:

  • Linux
  • Mac/Darwin
  • Windows (still struggle, but you need to try use WSL)

Installation

  • 📦 Extract the archive
  • 🗃 Locate somewhere in your machine
  • 💽 Copy a relative path that address that extension/driver
  • 📂 Open php.ini search ;extension if you using nano (ctrl+w) then searching for it
  • 📝 add in the next-line extension=liblibsql_php.so (in Linux) without ; at the begining

Check on your console/terminal

$ php --m | grep libsql
liblibsql_php

Now, you can use LibSQL class in your PHP code!


Database Setup

Install Turso CLI

Create a new turso database.

turso db create laravel-todo-list

💡 Note

We use laravel-todo-list as the database name in this command, but you can give it any name.

To access the data stored inside your database, you need the Turso database url and an authentication token.

To obtain the database url, run the following command:

turso db show laravel-todo-list --url

And, to create an authentication token for your database, run:

turso db tokens create laravel-todo-list

Add a .env file with the following variables, populating them with the values obtained above. Here we will use Remote Connection

DB_CONNECTION=libsql
DB_AUTH_TOKEN=
DB_SYNC_URL=
DB_REMOTE_ONLY=true

Add a .env file with the following variables, populating them with the values obtained above.

💡 Note

For more detail about environment variable to set, see at Turso Driver Laravel - Database Configuration

Create Migration & Seeders

Migrate the generated database schema by running:

php artisan migrate:fresh

To generate database seeders, run:

php artisan db:seed --class=DatabaseSeeder

By default, in this project we will generate 10 users using user factory.

Developing

Once you've created a database, migrate the database, and create database seeders by following the instructions above, install the project's dependencies by running:

composer install
npm install

To start development server, run:

php artisan serve --port=6969

Open another terminal to compile the assets views:

npm run dev

Now, you can view the application at http://127.0.0.1:6969