Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eliseekn/laravel-sanctum-starter-kit
An opinionated Laravel starter kit for RESTful API development with Sanctum.
https://github.com/eliseekn/laravel-sanctum-starter-kit
laravel php restful-api
Last synced: about 2 months ago
JSON representation
An opinionated Laravel starter kit for RESTful API development with Sanctum.
- Host: GitHub
- URL: https://github.com/eliseekn/laravel-sanctum-starter-kit
- Owner: eliseekn
- Created: 2022-10-15T14:03:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T09:42:44.000Z (5 months ago)
- Last Synced: 2024-08-23T10:57:20.486Z (5 months ago)
- Topics: laravel, php, restful-api
- Language: PHP
- Homepage:
- Size: 396 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Starter Kit for Laravel Sanctum
An opinionated Laravel starter kit for RESTful API development with Sanctum.## Requirements
- Laravel ^10
- PHP ^8.1## Features
- Login
- Registration
- Email verification
- Password reset
- Users management## To do
1. Add front-end url in the ***.env*** file
```php
FRONT_END_URL=http://localhost
```2. Edit the ***boot*** method in ***AuthServiceProvider.php*** file to ensure that your front-end endpoints are correct
```php
VerifyEmail::createUrlUsing(function ($notifiable) {
// $url is directly set as the API endpoint for email verification
// see 'verification.verify' route
$url = URL::temporarySignedRoute(
'verification.verify',
now()->addMinutes(Config::get('auth.verification.expire', 60)), [
'id' => $notifiable->getKey(),
'hash' => sha1($notifiable->getEmailForVerification()),
]
);return Config::get('app.frontend_url').'/email-verification?url='.urlencode($url);
});ResetPassword::createUrlUsing(
fn ($user, string $token) => Config::get('app.frontend_url').'/reset-password?email=' . $user->email . '&token='.$token
);
```
3. Setup your mail server## Testing
```php
php artisan test
```## Documenation
Run ```php artisan serve``` and open ```http://127.0.0.1:8000/docs``` in your web browser.