Skip to content

Commit 09fd942

Browse files
committed
fix syntax highlighting not working && reformat code
1 parent 100f038 commit 09fd942

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

db-models-and-eloquent.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ class Category extends Model
910910

911911
public function products()
912912
{
913-
return $this->hasMany(Product::class);
913+
return $this->hasMany(Product::class);
914914
}
915915
}
916916
```
@@ -1665,6 +1665,7 @@ protected function title(): Attribute
16651665
return new Attribute(
16661666
get: fn ($value) => strtoupper($value),
16671667
set: fn ($value) => strtolower($value),
1668+
);
16681669
}
16691670
```
16701671

@@ -2056,7 +2057,7 @@ class RatingSorter extends Sorter
20562057
$query
20572058
->selectRaw('AVG(product_ratings.rating) AS avg_rating')
20582059
->join('product_ratings', 'products.id', '=', 'product_ratings.product_id')
2059-
->groupBy('products.id');
2060+
->groupBy('products.id')
20602061
->when(
20612062
$this->direction === SortDirections::Desc,
20622063
fn () => $query->orderByDesc('avg_rating')

factories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The Laravel factory has a very useful `for()` method. You can use it to create `
8989
public function run()
9090
{
9191
Product::factory()
92-
->count(3);
92+
->count(3)
9393
->for(Category::factory()->create())
9494
->create();
9595
}

mail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class InvoicePaid extends Notification
9898
{
9999
return (new MailMessage)
100100
->success()
101-
->line('We've received your payment)
101+
->line('We\'ve received your payment')
102102
->when($user->isOnMonthlyPaymentPlan(), function (MailMessage $message) {
103103
$message->action('Save 20% by paying yearly', route('account.billing'));
104104
})

models-relations.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,12 @@ class Tournament extends Model
445445

446446
```php
447447
class TournamentsController extends Controller
448-
449-
public function whatever_method() {
450-
$tournaments = Tournament::with(['countries' => function($query) {
448+
{
449+
public function whatever_method() {
450+
$tournaments = Tournament::with(['countries' => function($query) {
451451
$query->orderBy('position');
452452
}])->latest()->get();
453+
}
453454
}
454455
```
455456

other.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ class MigrationsTest extends TestCase
735735
$this->expectNotToPerformAssertions();
736736

737737

738-
Artisan::call('migrate:fresh', ['--path' => '/database/migrations/task1']);
738+
Artisan::call('migrate:fresh', ['--path' => '/database/migrations/task1']);
739739
}
740740
}
741741
```
@@ -910,7 +910,7 @@ DateTime::createFromFormat('Y-m-d', '2021-10-12');
910910
// 2021-10-12 00:00:00.0
911911
DateTime::createFromFormat('!Y-m-d', '2021-10-12');
912912

913-
2021-10-12 21:00:00.0
913+
// 2021-10-12 21:00:00.0
914914
DateTime::createFromFormat('!Y-m-d H', '2021-10-12');
915915
```
916916

views.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ This will try to load adminlte.header, if missing - will load default.header
198198

199199
### Use Laravel Blade-X variable binding to save even more space
200200

201-
```php
201+
```blade
202202
// Using include, the old way
203203
@include("components.post", ["title" => $post->title])
204204
@@ -213,7 +213,7 @@ Tip given by [@anwar_nairi](https://twitter.com/anwar_nairi/status/1442441888787
213213

214214
### Blade components props
215215

216-
```php
216+
```blade
217217
// button.blade.php
218218
@props(['rounded' => false])
219219
@@ -236,7 +236,7 @@ Tip given by [@godismyjudge95](https://twitter.com/godismyjudge95/status/1448825
236236

237237
### Blade Autocomplete typehint
238238

239-
```php
239+
```blade
240240
@php
241241
/* @var App\Models\User $user */
242242
@endphp
@@ -253,7 +253,7 @@ Tip given by [@freekmurze](https://twitter.com/freekmurze/status/145546666392774
253253

254254
Did you know that if you pass colon (:) before the component parameter, you can directly pass variables without print statement `{{ }}`?
255255

256-
```php
256+
```blade
257257
<x-navbar title="{{ $title }}"/>
258258
259259
// you can do instead
@@ -376,7 +376,7 @@ In Laravel 9, you'll be able to use the cool new "checked" Blade directive.
376376

377377
This is going to be a nice addition that we can use to clean up our Blade views a little bit
378378

379-
```php
379+
```blade
380380
// Before Laravel 9:
381381
<input type="radio" name="active" value="1" {{ old('active', $user->active) ? 'checked' : '' }}/>
382382
<input type="radio" name="active" value="0" {{ old('active', $user->active) ? '' : 'checked' }}/>
@@ -394,7 +394,7 @@ In Laravel 9, you'll be able to use the cool new "selected" Blade directive for
394394

395395
This is going to be a nice addition that we can use to clean up our Blade views a little bit
396396

397-
```php
397+
```blade
398398
// Before Laravel 9:
399399
<select name="country">
400400
<option value="India" {{ old('country') ?? $country == 'India' ? 'selected' : '' }}>India</option>

0 commit comments

Comments
 (0)