- Add Analytics container: models, tasks, jobs, controllers, routes, services - Add analytics config with section groups (structure, institute, content, services) - Add database tables: analytics_sessions, analytics_hits, analytics_daily_stats - Add frontend: Analytics page, section detail, chart, overview, navigation components - Add consent banner and JS tracking service (sendBeacon + Inertia listener) - Add permission sync for view_analytics, view_any_analytic - Fix trailing slash URL matching in GetNavigationSectionsTask - Fix event propagation on expand arrows in navigation sections - Fix RecordVisitJob to not depend on dropped analytics_geo_cache table - Replace plain text views/visitors with badge-style icons - Group navigation sections by category with separate blocks - Add config-driven non-CMS sections (faculties, divisions, DPO, journals) - Remove Events, TV, Sveden from analytics sections
58 lines
2.0 KiB
PHP
Executable File
58 lines
2.0 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Containers\User\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\UserDetail>
|
|
*/
|
|
class UserDetailFactory extends Factory
|
|
{
|
|
protected $model = \App\Containers\User\Models\UserDetail::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition()
|
|
{
|
|
// Получаем пользователей, у которых еще нет UserDetail
|
|
|
|
// Генерация случайного количества наград и других полей
|
|
$awardsCount = rand(1, 5);
|
|
$awards = [];
|
|
for ($i = 0; $i < $awardsCount; $i++) {
|
|
$awards[] = ['item' => $this->faker->sentence(6)];
|
|
}
|
|
|
|
$generateItems = function () {
|
|
$itemsCount = rand(1, 5); // Случайное число от 1 до 5
|
|
$items = [];
|
|
for ($i = 0; $i < $itemsCount; $i++) {
|
|
$items[] = ['item' => $this->faker->sentence(6)];
|
|
}
|
|
return $items;
|
|
};
|
|
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'is_only_worker' => $this->faker->boolean,
|
|
'photo' => "images/01J7TKMCR55KY7ARS2DA6VVAHE.jpg",
|
|
'academicTitle' => $this->faker->word,
|
|
'AcademicDegree' => $this->faker->word,
|
|
'education' => [['item' => $this->faker->sentence(6)]],
|
|
'awards' => $awards,
|
|
'professDisciplines' => $generateItems(),
|
|
'professionalRetraining' => $generateItems(),
|
|
'professionalDevelopment' => $generateItems(),
|
|
'workExperience' => $generateItems(),
|
|
'attendedConferences' => $generateItems(),
|
|
'publications' => $generateItems(),
|
|
'contactEmail' => $this->faker->unique()->safeEmail,
|
|
'contactPhone' => $this->faker->phoneNumber,
|
|
];
|
|
}
|
|
} |