Skip to content

Commit

Permalink
Merge pull request #514 from DissNik/2.0
Browse files Browse the repository at this point in the history
docs(resources): add use for query tags
  • Loading branch information
DissNik authored Jun 30, 2024
2 parents efd01ad + c1a9759 commit 14ed448
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions resources/views/pages/en/resources/query_tags.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
namespace App\MoonShine\Resources;

use App\Models\Post;
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag; // [tl! focus]
use MoonShine\Resources\ModelResource;

Expand Down Expand Up @@ -54,6 +55,11 @@ public function queryTags(): array // [tl! focus:start]
</x-p>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'Post without an author',
fn(Builder $query) => $query->whereNull('author_id')
Expand All @@ -78,6 +84,11 @@ public function queryTags(): array // [tl! focus:start]
</x-code>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'All posts',
fn(Builder $query) => $query
Expand All @@ -94,6 +105,11 @@ public function queryTags(): array // [tl! focus:start]
</x-p>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'Post with author', // Tag title
fn(Builder $query) => $query->whereNotNull('author_id')
Expand All @@ -114,6 +130,11 @@ public function queryTags(): array // [tl! focus:start]
</x-p>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'Archived Posts',
fn(Builder $query) => $query->where('is_archived', true)
Expand Down
21 changes: 21 additions & 0 deletions resources/views/pages/ru/resources/query_tags.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
namespace App\MoonShine\Resources;

use App\Models\Post;
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag; // [tl! focus]
use MoonShine\Resources\ModelResource;

Expand Down Expand Up @@ -54,6 +55,11 @@ public function queryTags(): array // [tl! focus:start]
</x-p>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'Post without an author',
fn(Builder $query) => $query->whereNull('author_id')
Expand All @@ -78,6 +84,11 @@ public function queryTags(): array // [tl! focus:start]
</x-code>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'All posts',
fn(Builder $query) => $query
Expand All @@ -94,6 +105,11 @@ public function queryTags(): array // [tl! focus:start]
</x-p>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'Post with author', // Заголовок тега
fn(Builder $query) => $query->whereNotNull('author_id')
Expand All @@ -114,6 +130,11 @@ public function queryTags(): array // [tl! focus:start]
</x-p>

<x-code language="php">
use Illuminate\Database\Eloquent\Builder;
use MoonShine\QueryTags\QueryTag;

//...

QueryTag::make(
'Archived posts',
fn(Builder $query) => $query->where('is_archived', true)
Expand Down

0 comments on commit 14ed448

Please sign in to comment.