Skip to content

Commit 66084e8

Browse files
Update to Laravel 11.x
1 parent 9b8de37 commit 66084e8

13 files changed

+1971
-1417
lines changed

laravel-json-api/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://localhost
66

7+
IS_DEMO=false
8+
79
LOG_CHANNEL=stack
810
LOG_DEPRECATIONS_CHANNEL=null
911
LOG_LEVEL=debug

laravel-json-api/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
2+
3+
<p align="center">
4+
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
5+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
7+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
8+
</p>
9+
10+
## About Laravel
11+
12+
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13+
14+
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15+
- [Powerful dependency injection container](https://laravel.com/docs/container).
16+
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17+
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18+
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19+
- [Robust background job processing](https://laravel.com/docs/queues).
20+
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21+
22+
Laravel is accessible, powerful, and provides tools required for large, robust applications.
23+
24+
## Learning Laravel
25+
26+
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27+
28+
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
29+
30+
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
31+
32+
## Laravel Sponsors
33+
34+
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
35+
36+
### Premium Partners
37+
38+
- **[Vehikl](https://vehikl.com/)**
39+
- **[Tighten Co.](https://tighten.co)**
40+
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
41+
- **[64 Robots](https://64robots.com)**
42+
- **[Cubet Techno Labs](https://cubettech.com)**
43+
- **[Cyber-Duck](https://cyber-duck.co.uk)**
44+
- **[Many](https://www.many.co.uk)**
45+
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
46+
- **[DevSquad](https://devsquad.com)**
47+
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
48+
- **[OP.GG](https://op.gg)**
49+
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
50+
- **[Lendio](https://lendio.com)**
51+
52+
## Contributing
53+
54+
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
55+
56+
## Code of Conduct
57+
58+
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
59+
60+
## Security Vulnerabilities
61+
62+
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.
63+
64+
## License
65+
66+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use App\Models\User;
7+
use Illuminate\Support\Facades\Hash;
8+
9+
class ResetDefaultUsers extends Command
10+
{
11+
/**
12+
* The name and signature of the console command.
13+
*
14+
* @var string
15+
*/
16+
protected $signature = 'app:reset-default-users';
17+
18+
/**
19+
* The console command description.
20+
*
21+
* @var string
22+
*/
23+
protected $description = 'Resets the default users values';
24+
25+
/**
26+
* Execute the console command.
27+
*/
28+
public function handle(): void
29+
{
30+
if (env('IS_DEMO')) {
31+
$user = User::find('1');
32+
if ($user) {
33+
$user->update(['name' => 'Admin', 'email' => '[email protected]', 'password' => 'secret']);
34+
$users = User::where('id', '!=', '1');
35+
$users->delete();
36+
}
37+
}
38+
}
39+
}

laravel-json-api/app/Console/Kernel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ class Kernel extends ConsoleKernel
1515
*/
1616
protected function schedule(Schedule $schedule)
1717
{
18-
// $schedule->command('inspire')->hourly();
18+
$hour = config('app.hour');
19+
$min = config('app.min');
20+
$scheduledInterval = $hour !== '' ? (($min !== '' && $min != 0) ? $min . ' */' . $hour . ' * * *' : '0 */' . $hour . ' * * *') : '*/' . $min . ' * * * *';
21+
if (env('IS_DEMO')) {
22+
$schedule->command('app:reset-default-users')->cron($scheduledInterval);
23+
}
1924
}
2025

2126
/**

laravel-json-api/app/Providers/AppServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Providers;
44

5+
use Laravel\Passport\Passport;
56
use Illuminate\Support\ServiceProvider;
67

78
class AppServiceProvider extends ServiceProvider
@@ -23,6 +24,6 @@ public function register()
2324
*/
2425
public function boot()
2526
{
26-
//
27+
Passport::enablePasswordGrant();
2728
}
2829
}

laravel-json-api/composer.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22
"name": "laravel/laravel",
33
"type": "project",
44
"description": "The Laravel Framework.",
5-
"keywords": ["framework", "laravel"],
5+
"keywords": [
6+
"framework",
7+
"laravel"
8+
],
69
"license": "MIT",
710
"require": {
811
"php": "^8.1",
912
"guzzlehttp/guzzle": "^7.2",
10-
"laravel-json-api/laravel": "^3.0",
11-
"laravel/framework": "^10.0",
12-
"laravel/passport": "^11.3",
13-
"laravel/sanctum": "^3.0",
13+
"laravel-json-api/laravel": "^4.0",
14+
"laravel/framework": "^11.0",
15+
"laravel/passport": "^12.0",
16+
"laravel/sanctum": "^4.0",
1417
"laravel/tinker": "^2.7"
1518
},
1619
"require-dev": {
1720
"fakerphp/faker": "^1.9.1",
18-
"laravel-json-api/testing": "^2.0",
21+
"laravel-json-api/testing": "^3.0",
1922
"laravel/pint": "^1.0",
2023
"laravel/sail": "^1.0.1",
2124
"mockery/mockery": "^1.4.4",
22-
"nunomaduro/collision": "^7.0",
25+
"nunomaduro/collision": "^8.1",
2326
"phpunit/phpunit": "^10.0",
2427
"spatie/laravel-ignition": "^2.0"
2528
},
@@ -65,4 +68,4 @@
6568
},
6669
"minimum-stability": "dev",
6770
"prefer-stable": true
68-
}
71+
}

0 commit comments

Comments
 (0)