Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions 2.x/features/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ use Laravel\Fortify\Fortify;

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
Fortify::loginView(function () {
return view('auth.login');
Expand Down Expand Up @@ -75,10 +73,8 @@ use Laravel\Fortify\Fortify;

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
// ...

Expand Down
15 changes: 5 additions & 10 deletions 2.x/features/password-confirmation.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ After adding this trait to a component, you should call the `ensurePasswordIsCon
```php
/**
* Enable administration mode for user.
*
* @return void
*/
public function enableAdminMode()
public function enableAdminMode(): void
{
$this->ensurePasswordIsConfirmed();

Expand Down Expand Up @@ -129,10 +127,8 @@ After adding the `confirms-password` component to your application's user interf
```php
/**
* Enable administration mode for user.
*
* @return void
*/
public function enableAdminMode()
public function enableAdminMode(): void
{
$this->ensurePasswordIsConfirmed();

Expand Down Expand Up @@ -185,19 +181,18 @@ Once the user has confirmed their password, they will not be required to re-ente
Sometimes, you may wish to customize how the user's password is validated during confirmation. To do so, you may use the `Fortify::confirmPasswordsUsing` method. This method accepts a closure that receives the authenticated user instance and the `password` input field of the request. The closure should return `true` if the password is valid for the given user. Typically, this method should be called from the `boot` method of your `JetstreamServiceProvider`:

```php
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Laravel\Fortify\Fortify;

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
// ...

Fortify::confirmPasswordsUsing(function ($user, string $password) {
Fortify::confirmPasswordsUsing(function (User $user, string $password) {
return Hash::check($password, $user->password);
});
}
Expand Down
4 changes: 1 addition & 3 deletions 2.x/features/registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ use Laravel\Fortify\Fortify;

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
Fortify::registerView(function () {
return view('auth.register');
Expand Down
6 changes: 1 addition & 5 deletions 2.x/features/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,8 @@ When building a Jetstream application that provides both API support and team su
```php
/**
* Determine whether the user can view a flight.
*
* @param \App\Models\User $user
* @param \App\Models\Flight $flight
* @return bool
*/
public function view(User $user, Flight $flight)
public function view(User $user, Flight $flight): bool
{
return $user->belongsToTeam($flight->team) &&
$user->hasTeamPermission($flight->team, 'flight:view') &&
Expand Down
10 changes: 3 additions & 7 deletions 2.x/stacks/inertia.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ In other words, this stack gives you the full power of Vue.js without the comple
```php
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

/**
* Show the general profile settings screen.
*
* @param \Illuminate\Http\Request $request
* @return \Inertia\Response
*/
public function show(Request $request)
public function show(Request $request): Response
{
return Inertia::render('Profile/Show', [
'sessions' => $this->sessions($request)->all(),
Expand Down Expand Up @@ -51,10 +49,8 @@ use Laravel\Jetstream\Jetstream;

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
// ...

Expand Down
8 changes: 2 additions & 6 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
Queue::before(function (JobProcessing $event) {
// $event->connectionName
Expand All @@ -74,10 +72,8 @@ class AppServiceProvider extends ServiceProvider

/**
* Register the service provider.
*
* @return void
*/
public function register()
public function register(): void
{
//
}
Expand Down