Skip to content

Commit c2ad1b0

Browse files
committed
Remove trailing whitespace and final new lines
1 parent df39ca8 commit c2ad1b0

13 files changed

+16
-25
lines changed

api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function handle($request, Closure $next)
238238
Second, register the created middleware in app/Http/Kernel.php file:
239239

240240
```php
241-
protected $middlewareGroups = [
241+
protected $middlewareGroups = [
242242
'api' => [
243243
\App\Http\Middleware\ForceJsonResponse::class,
244244
],
@@ -255,12 +255,12 @@ Tip given by [Feras Elsharif](https://github.com/ferasbbm)
255255

256256
If you are working on a project that may have multi-release in the future or your endpoints have a breaking change like a change in the format of the response data, and you want to ensure that the API version remains functional when changes are made to the code.
257257

258-
#### Change The Default Route Files
258+
#### Change The Default Route Files
259259
The first step is to change the route map in the `App\Providers\RouteServiceProvider` file, so let's get started:
260260

261261
#### Laravel 8 and above:
262262

263-
Add a 'ApiNamespace' property
263+
Add a 'ApiNamespace' property
264264

265265
```php
266266
/**
@@ -279,7 +279,7 @@ $this->routes(function () {
279279
->namespace($this->ApiNamespace.'\\V1')
280280
->group(base_path('routes/API/v1.php'));
281281
}
282-
282+
283283
//for v2
284284
Route::prefix('api/v2')
285285
->middleware('api')
@@ -304,7 +304,7 @@ protected string $ApiNamespace = 'App\Http\Controllers\Api';
304304
Inside the method map, add the following code:
305305

306306
```php
307-
// remove this $this->mapApiRoutes();
307+
// remove this $this->mapApiRoutes();
308308
$this->mapApiV1Routes();
309309
$this->mapApiV2Routes();
310310
```
@@ -345,8 +345,8 @@ Controllers
345345
```
346346
routes
347347
└── Api
348-
│ └── v1.php
349-
│ └── v2.php
348+
│ └── v1.php
349+
│ └── v2.php
350350
└── web.php
351351
```
352352

auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Gate::before(function (?User $user, $ability) {
122122

123123
Laravel's authentication system fires various events during the authentication process, allowing you to hook into these events and perform additional actions or custom logic.
124124

125-
For example, you might want to log users Login.
125+
For example, you might want to log users Login.
126126
You can achieve this by listening to the `Illuminate\Auth\Events\Login` event.
127127

128128
To implement it:

collections.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,3 @@ Collection::times(7, function ($number) {
144144
```
145145

146146
Tip given by [@Teacoders](https://twitter.com/Teacoders/status/1509447909602906116)
147-

db-models-and-eloquent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,14 +2199,14 @@ class CategoryController extends Controller
21992199
{
22002200
// instead of
22012201
$category = Category::where('name', $request->name)->first();
2202-
2202+
22032203
if (!$category) {
22042204
$category = Category::create([
22052205
'name' => $request->name,
22062206
'slug' => Str::slug($request->name),
22072207
]);
22082208
}
2209-
2209+
22102210
// you can use
22112211
$category = Category::firstOrCreate([
22122212
'name' => $request->name,

factories.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,3 @@ class EventSeeder extends Seeder
141141
```
142142

143143
Tip given by [@justsanjit](https://twitter.com/justsanjit/status/1514428294418079746)
144-

log-and-debug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ If you want to implement a new listener to a specific event but you don't know i
120120

121121
You can use the `\Illuminate\Support\Facades\Event::listen()` method on `boot()` method of `app/Providers/EventServiceProvider.php` to catch all events fired.
122122

123-
**Important:** If you use the `Log` facade within this event listener then you will need to exclude events named `Illuminate\Log\Events\MessageLogged` to avoid an infinite loop.
123+
**Important:** If you use the `Log` facade within this event listener then you will need to exclude events named `Illuminate\Log\Events\MessageLogged` to avoid an infinite loop.
124124
(Example: `if ($event == 'Illuminate\\Log\\Events\\MessageLogged') return;`)
125125

126126
```php

mail.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,3 @@ class InvoicePaid extends Notification
110110
Use the `when` or `unless` methods in you own classes by using the `Illuminate\Support\Traits\Conditionable` trait
111111

112112
Tip given by [@Philo01](https://twitter.com/Philo01/status/1503302749525528582)
113-

migrations.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ If you want to check what migrations are executed or not yet, no need to look at
7070
Example result:
7171

7272
```
73-
Migration name .......................................................................... Batch / Status
74-
2014_10_12_000000_create_users_table ........................................................... [1] Ran
75-
2014_10_12_100000_create_password_resets_table ................................................. [1] Ran
76-
2019_08_19_000000_create_failed_jobs_table ..................................................... [1] Ran
73+
Migration name .......................................................................... Batch / Status
74+
2014_10_12_000000_create_users_table ........................................................... [1] Ran
75+
2014_10_12_100000_create_password_resets_table ................................................. [1] Ran
76+
2019_08_19_000000_create_failed_jobs_table ..................................................... [1] Ran
7777
```
7878

7979
### Create Migration with Spaces
@@ -302,4 +302,3 @@ Schema::create('posts', function (Blueprint $table) {
302302
```
303303

304304
Tip given by [@iamgurmandeep](https://twitter.com/iamgurmandeep/status/1517152425748148225)
305-

models-relations.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,4 +680,3 @@ select * from posts where user_id = ? and (active = 1 or votes >= 100)
680680
```
681681

682682
Tip given by [@BonnickJosh](https://twitter.com/BonnickJosh/status/1494779780562096139)
683-

other.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class TerminatingMiddleware
112112
{
113113
return $next($request);
114114
}
115-
115+
116116
public function terminate($request, $response)
117117
{
118118
// ...
@@ -1522,4 +1522,3 @@ If you ever need to bypass database when a job fails, you can do one of the belo
15221522
Why you would want this? For applications where you do not need to store failed jobs and they needs to have very high TPS, skipping database can be very favourable as we are not hitting database, saving times & prevent database going down.
15231523

15241524
Tip given by [@a-h-abid](https://github.com/a-h-abid)
1525-

0 commit comments

Comments
 (0)