diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 2d8ba45fab2..ba2dff617cb 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -237,12 +237,14 @@ export const gettingstarted: NavMenuConstant = { { name: 'Next.js', url: '/guides/getting-started/quickstarts/nextjs' }, { name: 'React', url: '/guides/getting-started/quickstarts/reactjs' }, { name: 'NuxtJS', url: '/guides/getting-started/quickstarts/nuxtjs' }, - { name: 'RedwoodJS', url: '/guides/getting-started/quickstarts/redwoodjs' }, + { name: 'Vue', url: '/guides/getting-started/quickstarts/vue' }, { name: 'Flutter', url: '/guides/getting-started/quickstarts/flutter' }, { name: 'Android Kotlin', url: '/guides/getting-started/quickstarts/kotlin' }, { name: 'SvelteKit', url: '/guides/getting-started/quickstarts/sveltekit' }, + { name: 'Laravel PHP', url: '/guides/getting-started/quickstarts/laravel' }, + { name: 'Ruby on Rails', url: '/guides/getting-started/quickstarts/ruby-on-rails' }, { name: 'SolidJS', url: '/guides/getting-started/quickstarts/solidjs' }, - { name: 'Vue', url: '/guides/getting-started/quickstarts/vue' }, + { name: 'RedwoodJS', url: '/guides/getting-started/quickstarts/redwoodjs' }, { name: 'refine', url: '/guides/getting-started/quickstarts/refine' }, ], }, diff --git a/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx b/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx new file mode 100644 index 00000000000..4d71b2811fe --- /dev/null +++ b/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx @@ -0,0 +1,111 @@ +import Layout from '~/layouts/DefaultGuideLayout' +import StepHikeCompact from '~/components/StepHikeCompact' + +export const meta = { + title: 'Use Supabase with Laravel', + subtitle: + 'Learn how to create a PHP Laravel project, connect it to your Supabase Postgres database, and configure user authentication.', + breadcrumb: 'Framework Quickstarts', +} + + + + + + + Make sure your PHP and Composer versions are up to date, then use `composer create-project` to scaffold a new Laravel project. + + See the [Laravel docs](https://laravel.com/docs/10.x/installation#creating-a-laravel-project) for more details. + + + + + + ```bash Terminal + composer create-project laravel/laravel example-app + ``` + + + + + + + + + Install [Laravel Breeze](https://laravel.com/docs/10.x/starter-kits#laravel-breeze), a simple implementation of all of Laravel's [authentication features](https://laravel.com/docs/10.x/authentication). + + + + + + ```bash Terminal + composer require laravel/breeze --dev + php artisan breeze:install + ``` + + + + + + + + + Go to [database.new](https://database.new) and create a new Supabase project. Save your database password securely. + + When your project is up and running, navigate to the [database settings](https://supabase.com/dashboard/project/_/settings/database) to find the URI connection string. + + Laravel ships with a Postgres adapter out of the box, you can simply configure it via the environment variables. You can find the database URL in your [Supabase Dashboard](/dashboard/project/_/settings/database). + + + + + + ```bash .env + DB_CONNECTION=pgsql + DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT-REF].supabase.co:5432/postgres + ``` + + + + + + + + + Laravel ships with database migration files that set up the required tables for Laravel Authentication and User Management. + + Note: Laravel does not use Supabase Auth but rather implements its own authentication system! + + + + + + ```bash Terminal + php artisan migrate + ``` + + + + + + + + + Run the development server. Go to http://127.0.0.1:8000 in a browser to see your application. You can also nvaigate to http://127.0.0.1:8000/register and http://127.0.0.1:8000/login to register and log in users. + + + + + + ```bash Terminal + php artisan serve + ``` + + + + + + + +export const Page = ({ children }) => +export default Page diff --git a/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx b/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx new file mode 100644 index 00000000000..fd61f26590e --- /dev/null +++ b/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx @@ -0,0 +1,117 @@ +import Layout from '~/layouts/DefaultGuideLayout' +import StepHikeCompact from '~/components/StepHikeCompact' + +export const meta = { + title: 'Use Supabase with Ruby on Rails', + subtitle: + 'Learn how to create a Rails project and connect it to your Supabase Postgres database.', + breadcrumb: 'Framework Quickstarts', +} + + + + + + + Make sure your Ruby and Rails versions are up to date, then use `rails new` to scaffold a new Rails project. Use the `-d=postgresql` flag to set it up for Postgres. + + Go to the [Rails docs](https://guides.rubyonrails.org/getting_started.html) for more details. + + + + + + ```bash Terminal + rails new blog -d=postgresql + ``` + + + + + + + + + Go to [database.new](https://database.new) and create a new Supabase project. Save your database password securely. + + When your project is up and running, navigate to the [database settings](https://supabase.com/dashboard/project/_/settings/database) to find the URI connection string. + + Rails ships with a Postgres adapter included, you can simply configure it via the environment variables. You can find the database URL in your [Supabase Dashboard](/dashboard/project/_/settings/database). + + + + + + ```bash Terminal + export DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT-REF].supabase.co:5432/postgres + ``` + + + + + + + + + Rails includes Active Record as the ORM as well as database migration tooling which generates the SQL migration files for you. + + Create an example `Article` model and generate the migration files. + + + + + + ```bash Terminal + bin/rails generate model Article title:string body:text + bin/rails db:migrate + ``` + + + + + + + + + You can use the included Rails console to interact with the database. For example, you can create new entries or list all entries in a Model's table. + + + + + + ```bash Terminal + bin/rails console + ``` + + ```rb irb + article = Article.new(title: "Hello Rails", body: "I am on Rails!") + article.save # Saves the entry to the database + + Article.all + ``` + + + + + + + + + Run the development server. Go to http://127.0.0.1:3000 in a browser to see your application running. + + + + + + ```bash Terminal + bin/rails server + ``` + + + + + + + +export const Page = ({ children }) => +export default Page