740 Commits

Author SHA1 Message Date
Punyapal Shah
c9c8fb9ee7
Refactor User model to use HasFactory trait and add type hint for UserFactory (#6453) 2024-09-19 06:22:19 -05:00
Taylor Otwell
428a190050
[11.x] Slim skeleton (#6188)
See: https://github.com/laravel/framework/pull/47309

# Laravel 11 Skeleton Overview

### General Notes

More environment variables have been added to the `.env.example` file. 

The default `QUEUE_CONNECTION` variable value has been updated to `database` instead of `sync`.

The `BROADCAST_DRIVER` and `CACHE_DRIVER` environment variables have been renamed to `BROADCAST_CONNECTION` and `CACHE_STORE`, respectively.

The HTTP Kernel has been removed. Configuration that was previously done in this file can be done in the `bootstrap/app.php` file, including registering / replacing middleware.

The console kernel has been removed. Schedules can be defined in the console “routes” file. Commands generated by `make:command` are automatically loaded and do not require registration. Additional command loading paths can be registered in the `bootstrap/app.php` file.

The exception handler has been removed. Exception handling behavior can be configured in the `bootstrap/app.php` file via `reportable`, `renderable`, `throttle`, and more. Callbacks received by these functions will have their type hints inspected to see if they handle a given exception.

The base HTTP controller no longer extends any other classes (requiring new middleware definition feature). No traits are included by default on the base controller. Authorization can be done using facades, or traits can be added manually.

All middleware has been removed. Configuration of these middleware’s behavior can be done via static methods on the middleware themselves (see framework notes).

The `User` model now utilizes a `casts` method instead of a property. The `HasApiTokens` trait has been removed by default since Sanctum is not installed by default.

All service providers except the `AppServiceProvider` have been removed. Policies are auto-discovered and gates can be registered in `AppServiceProvider`. Likewise, events can be registered in `AppServiceProvider`. Routing behavior is now determined / customized in the `bootstrap/app.php` file.

New `bootstrap/app.php` file can be used to customize core framework behavior like routing, container bindings, middleware, and exception handling.

Sanctum is no longer installed by default (see `install:api`).

Configuration files are not present by default. Can be published by `config:publish` command. Default values are present in the framework and application level configuration now cascades with framework definitions, so only customized values need be present in application level configuration files.

Migration files have been re-dated to be evergreen. The `password_reset_tokens` table migration has been combined into the `users` table migration file. Likewise, the `jobs` table migration has been combined into a single migration with the `failed_jobs` table.

Echo bootstrapping has been removed by default. It is re-inserted by new `install:broadcasting` command.

API and channel routes files are not present by default, can be recreated by `install:api` and `install:broadcasting` respectively.
2023-11-28 14:28:15 -06:00
Eliezer Margareten
84991f2301
Update Kernel.php (#6193) 2023-06-07 08:20:56 -05:00
Eliezer Margareten
7e0a2db2e0
Add hashed cast to user password (#6171)
* Add `hashed` cast to user password

* Update composer.json
2023-05-10 13:51:00 -05:00
Taylor Otwell
ebf9d30bf3
[10.x] Minor skeleton slimming (#6159)
* remove rate limiter from route provider by default

* remove policy place holder

* remove broadcast skeleton in favor of new provider in core

* use default provider collection

* Remove unnecessary properties from exception handler.

* add back broadcast provider

* update comment

* add rate limiting

* Apply fixes from StyleCI

* fix formatting

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-04-15 16:53:39 -05:00
Taylor Otwell
7cc6699c3d clean up comment 2023-04-11 17:17:24 -05:00
Taylor Otwell
3986d4c540 remove unneeded call 2023-02-16 13:38:12 -06:00
Taylor Otwell
edcbe6de7c rename property for clarity 2023-01-27 14:08:28 +00:00
Jason McCreary
de868f0fc7
Use nullable typing (#6084) 2023-01-27 11:53:58 +00:00
Taylor Otwell
f62d260c76 remove dispatches job trait 2023-01-25 18:08:59 +00:00
Nuno Maduro
55af5469c3
[10.x] Uses PHP Native Type Declarations 🐘 (#6010)
* Adds basic typing around method's arguments and return types

* Adds missing `closure` type

* Adds typing on tests

* Fixes `RedirectIfAuthenticated`

* Fixes `Authenticate`

* Improves `RedirectIfAuthenticated` types

* Fixes user factory `unverified` return type
2023-01-03 10:35:24 +01:00
Taylor Otwell
e2e25f607a use except 2022-08-20 12:46:21 -05:00
Taylor Otwell
858a3ca662 wip 2022-08-15 10:21:08 -05:00
Taylor Otwell
951c9c8501 wip 2022-08-15 10:20:30 -05:00
Stephen Rees-Carter
dbced6ac8c
Add ValidateSignature middleware for ignore params (#5942)
* Add ValidateSignature middleware for ignore params

* Comment out query parameters by default

* Remove leading slash

* Update Kernel ValidateSignature middleware path
2022-08-15 10:19:56 -05:00
Nuno Maduro
fa5e54a2ab
[9.x] Uses laravel/pint for styling (#5945)
* Uses `laravel/pint` for styling

* Makes `.styleci.yml` ignored on export

* Update composer.json

Co-authored-by: Dries Vints <dries@vints.io>
2022-07-15 08:38:49 -05:00
Taylor Otwell
7216fa7e9a a few wording changes 2022-05-05 14:52:25 -05:00
Taylor Otwell
d5d2b67dcb fix docblock 2022-04-12 09:34:17 -05:00
Taylor Otwell
a8cefc2dd1 update wording 2022-04-12 09:31:23 -05:00
Taylor Otwell
a507e14243 add levels to handler 2022-04-12 09:30:48 -05:00
Ostap Brehin
b630eae0b3
Update RouteServiceProvider.php (#5862) 2022-04-11 09:07:05 -05:00
Taylor Otwell
d650fa2a30
[9.x] Make authenticate session a route middleware (#5842)
* make authenticate session a route middleware

* Update Kernel.php
2022-03-29 09:48:17 -05:00
Dries Vints
ecf7b06c4b
Replace Laravel CORS package (#5825) 2022-02-22 09:42:30 -06:00
emargareten
4a6229aa65
Update RouteServiceProvider.php (#5818) 2022-02-16 08:18:19 -06:00
Dries Vints
376ed676ee
Update RouteServiceProvider.php (#5816) 2022-02-15 08:32:48 -06:00
Taylor Otwell
5901059eba add discovery method default 2022-02-09 08:53:30 -06:00
Dries Vints
274d1bdd72
Merge branch '8.x'
# Conflicts:
#	CHANGELOG.md
2021-12-07 17:10:58 +01:00
Nuno Maduro
8a62ca2633
Improves generic types on the skeleton (#5740) 2021-12-03 09:04:57 -06:00
Bram
7bf32280e2
[8.x] Add types to arrays in boilerplate (#5738)
* Add more specific types

* Update Authenticate.php

* Update Authenticate.php
2021-12-02 14:40:24 -06:00
Dries Vints
fcb4d9df1a
Merge branch '8.x'
# Conflicts:
#	CHANGELOG.md
2021-11-23 18:31:32 +01:00
Nuno Maduro
33ceba78ba
Removes the commands property (#5727) 2021-11-18 10:18:32 -06:00
Dries Vints
d54907c27d
Merge branch '8.x'
# Conflicts:
#	CHANGELOG.md
#	composer.json
2021-10-26 17:22:00 +02:00
Can Vural
1542783002
PHPDoc types should be covariant with the parent type (#5714) 2021-10-25 13:16:13 -05:00
Dries Vints
ec9ff4cd68
Merge branch '8.x'
# Conflicts:
#	CHANGELOG.md
2021-08-24 18:00:23 +02:00
Maarten Buis
7c99346801
[8.x] Use PHPDoc comments from base class in User model (#5676)
* Use phpdoc comments from Model class

* Update User.php
2021-08-23 08:47:37 -05:00
Gabriel Pillet
8677c94a50
Fixing "Line exceeds 120 characters" in TrustProxies (#5677)
To comply with PSR-2
2021-08-23 08:42:15 -05:00
Iman
5f9dbb41b5
[9.x] Use php 8 null safe operator (#5670)
This PR leverages php 8 "null safe operator" instead of thrr `optional()` helper
2021-08-17 08:09:03 -05:00
Taylor Otwell
226d1bfc3c
[8.x] Sanctum (#5663)
* initial sanctum poc

* add files

* remove token
2021-08-11 13:44:34 -05:00
Dries Vints
b6f4ee7661
Use new TrustProxies middleware (#5662) 2021-08-10 08:41:29 -05:00
Rodrigo Pedra Brum
03be0afb44
Don't trim current_password (#5546)
Inspired by https://github.com/laravel/framework/pull/36415

As JetStream/Fortify uses a `current_password` field when allowing a user to change their password, and as JetStream is one of the starter kits listed on the docs, this PR adds `current_password` in the `$except` option of the `TrimStrings` middleware.
2021-03-01 07:38:37 -06:00
Hugo Clarke-Wing
f0de9fd996
Don't flash 'current_password' input (#5541)
* Don't flash `current_password` input

With starter packs like Jetstream, the `current_password` input is used.

I believe that adding `current_password` to the `$dontFlash` list by default would help to ensure new projects follow security best practices from the get-go.

* Update Handler.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
2021-02-19 09:09:51 -06:00
Dries Vints
f97e551071
Update TrustProxies.php (#5514) 2021-01-12 11:18:35 -06:00
Taylor Otwell
b7cde8b495 comment trust hosts 2020-12-10 07:14:14 -06:00
Daniel Coulbourne
f6f772ba54
Uncomment TrustHosts middleware to enable it by default. (#5477) 2020-11-26 08:38:56 -06:00
Taylor Otwell
4931af1400 add stub handler 2020-11-14 09:17:41 -06:00
Taylor Otwell
bec982b0a3 update by 2020-10-22 16:01:59 -05:00
Viktor Szépe
453d7286f3
Revert per user API rate limit
It was changed from per user to per application in ced3e50bca279f5a499a6d513fcdfd2a020c28ce
2020-10-22 22:41:03 +02:00
Andrew Brown
38bc9119eb
type hint the middleware Request (#5438)
stemming from https://github.com/laravel/framework/pull/34224
2020-10-02 08:31:13 -05:00
Taylor Otwell
a6ca577839 add comment 2020-09-22 14:17:27 -05:00
Ricardo Gobbo de Souza
d3353c9e9a
Fix route when uncomment $namespace (#5424) 2020-09-22 09:23:40 -05:00