Gale is an authentication addon for the Goravel framework, designed to simplify and enhance user authentication processes.
| kkumar-gcc/gale | goravel/framework |
|---|---|
| v1.0.x | v1.14.x |
To install Gale globally, use the following command:
go install github.com/kkumar-gcc/gale@latestAlternatively, you can install Gale directly within your Goravel project:
- Add Gale as a Dependency
Navigate to your Goravel project directory and run:
go get -u github.com/kkumar-gcc/gale- Register Gale's Service Provider
To make Gale functional within your project, you need to register its service provider in yourconfig/app.gofile:
import (
gale "github.com/kkumar-gcc/gale/providers"
)
"providers": []foundation.ServiceProvider{
// ...
&gale.ServiceProvider{},
}- Run Gale Installation Command
After adding Gale to your project, run the following command within your project directory to install the necessary files:
go run . artisan install
## global installation
gale installOptions provided by the install command:
--stack / -s: Specifies the authentication stack to install. Options:api.--driver / -m: Specifies the database driver to use. Options:mysql,postgres,sqlite.
To integrate Gale into your Goravel application, follow these steps:
- Add Authentication Routes
Add theAuthfunction fromroutes/auth.goto yourroute_service_provider.gofile. This will register the authentication routes provided by Gale:
func (receiver *RouteServiceProvider) Boot(app foundation.Application) {
// ...
routes.Auth()
}- Run Migrations
Run the following command to execute the migrations required for Gale to function:
go run . artisan migrate:freshGale is open-source software licensed under the MIT license.