-
Notifications
You must be signed in to change notification settings - Fork 16
Documentation search #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation search #114
Changes from all commits
1cedb17
5240acb
67d9161
2961d7b
49ce61b
e6fb9f4
ba25d66
e78d204
9e3e5d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,5 @@ QUIZ_STATUS=false | |
TELEGRAM_BOT_TOKEN= | ||
TELEGRAM_CHAT_ID= | ||
TELEGRAM_CHANNEL_ID= | ||
|
||
SCOUT_DRIVER= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Casts\Attribute; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Laravel\Scout\Searchable; | ||
|
||
class DocumentationSection extends Model | ||
{ | ||
use HasFactory, HasUuids, Searchable; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
* | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'id', | ||
'title', | ||
'title_page', | ||
'slug', | ||
'version', | ||
'file', | ||
'content', | ||
'level', | ||
]; | ||
|
||
/** | ||
* @return \Illuminate\Database\Eloquent\Casts\Attribute | ||
*/ | ||
protected function fileForUrl(): Attribute | ||
{ | ||
return Attribute::make( | ||
get: fn (mixed $value, array $attributes) => str_replace('.md', '', $attributes['file']), | ||
); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function toSearchableArray() | ||
{ | ||
return [ | ||
'title' => $this->title, | ||
'content' => $this->content, | ||
'level' => $this->level, | ||
]; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('documentation_sections', function (Blueprint $table) { | ||
$table->uuid('id')->primary(); | ||
$table->string('title_page')->comment('Заголовок всей страницы'); | ||
$table->string('title'); | ||
$table->integer('level')->nullable()->comment('Уровень заголовка'); | ||
$table->string('slug'); | ||
$table->string('version'); | ||
$table->string('file'); | ||
$table->text('content'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('documentation_sections'); | ||
} | ||
}; |
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
Unchanged files with check annotations Beta
class PositionsController extends Controller | ||
{ | ||
/** | ||
* @return \Illuminate\Contracts\View\View|\HotwiredLaravel\\Http\MultiplePendingTurboStreamResponse|\HotwiredLaravel\\Http\PendingTurboStreamResponse|null | ||
Check failure on line 16 in app/Http/Controllers/PositionsController.php
|
||
*/ | ||
public function jobs() | ||
{ | ||
} | ||
/** | ||
* @return \Illuminate\Contracts\View\View|\HotwiredLaravel\\Http\MultiplePendingTurboStreamResponse|\HotwiredLaravel\\Http\PendingTurboStreamResponse|null | ||
Check failure on line 148 in app/Http/Controllers/PositionsController.php
|
||
*/ | ||
public function latest() | ||
{ |
class PostController extends Controller | ||
{ | ||
/** | ||
* @return \Illuminate\Contracts\View\View|\HotwiredLaravel\\Http\MultiplePendingTurboStreamResponse|\HotwiredLaravel\\Http\PendingTurboStreamResponse|null | ||
Check failure on line 14 in app/Http/Controllers/PostController.php
|
||
*/ | ||
public function feed() | ||
{ | ||
/** | ||
* @param \Illuminate\Http\Request $request | ||
* | ||
* @return \HotwiredLaravel\\Http\MultiplePendingTurboStreamResponse|\HotwiredLaravel\\Http\PendingTurboStreamResponse | ||
Check failure on line 74 in app/Http/Controllers/PostController.php
|
||
*/ | ||
public function preview(Request $request) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как насчет комментария хотя бы? 😀