Commit Graph

22 Commits

Author SHA1 Message Date
Kazem Alghasi
b6b2057df2 اولین کامیت پروژه vernova 2026-07-26 19:58:27 +03:30
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
Jason McCreary
de868f0fc7
Use nullable typing (#6084) 2023-01-27 11:53:58 +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
Can Vural
40f93daa83
Update redirectTo return type PHPDoc 2019-12-14 11:48:14 +01:00
Dries Vints
6f3aa7a4c5
Don't redirect for api calls
When calling api routes the Authenticate middleware attempts to redirect you to the login page. If you expect JSON back or don't have auth routes then you don't want this to happen. By re-using the logic from Laravel's exception handler on which format to output we can also determine wether to redirect the user to the login page or give them a JSON error response.
2018-10-12 15:40:15 +02:00
Taylor Otwell
a14e62325c customizable redirect on auth failure 2018-03-13 16:09:47 -05:00
Joseph Silber
945052508f Use the Authenticate middleware from core 2016-05-26 13:07:11 -04:00
Joseph Silber
6dfc0229b2 Make the Authenticate middleware throw an AuthenticationException 2016-05-22 14:50:39 -04:00
Joseph Silber
f7d05cbbaa Set the default driver from the Authenticate middleware 2016-03-28 09:48:35 -04:00
Joseph Silber
703197e27a Allow passing multiple gaurds to the auth middleware 2016-03-17 10:22:19 -07:00
Jacob Bennett
5b3c5f3f4e Don't return a login page to a JSON request
Currently, any unauthorized API requests that pass through the `auth` middleware get a redirect to the login page. Adding the `wantsJson` flag to the conditional corrects this behavior.
2016-01-22 10:01:39 -06:00
Taylor Otwell
2ea2ae0f3f allow guard to be specified on middleaware 2015-12-05 21:56:17 -06:00
Taylor Otwell
ba7137dcb0 update routes and middleware 2015-12-03 23:11:04 -06:00
Taylor Otwell
8414d45cdc update middleware and config 2015-12-03 12:25:38 -06:00
Graham Campbell
bf3785d0bc Additional cs fixes
Signed-off-by: Graham Campbell <graham@cachethq.io>
2015-06-01 15:46:45 +01:00
Taylor Otwell
8909e75552 Some spacing. 2015-03-02 15:31:27 -06:00
Taylor Otwell
4c78958b5b Tweak a few things. 2015-02-22 22:37:16 -06:00
Taylor Otwell
cc2139ac91 Tweaking a few things. 2015-02-22 21:56:03 -06:00
Taylor Otwell
f424b87a63 PSR-2 for app. 2015-02-22 20:47:03 -06:00
Taylor Otwell
caa166f5d6 Remove middleware interface. 2015-01-05 13:16:21 -06:00
Taylor Otwell
ca2f02284c Rename middleware to more "action" words. 2014-11-11 12:51:55 -06:00