Added User Settings
This commit is contained in:
@@ -272,7 +272,7 @@ class FlightController extends Controller
|
|||||||
$updated = $flight->snapshot($flight->id);
|
$updated = $flight->snapshot($flight->id);
|
||||||
$this->recordChanges($flight, $dirty, $original, $updated);
|
$this->recordChanges($flight, $dirty, $original, $updated);
|
||||||
|
|
||||||
return redirect()->route('profile.departure-board', [Auth::user()->name, $flight->id]);
|
return redirect()->route('profile.departure-board', [$flight->user->name, $flight->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(UserFlight $flight, ?string $referrer = 'departure-board')
|
public function delete(UserFlight $flight, ?string $referrer = 'departure-board')
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class FlightProfileController extends Controller
|
|||||||
public function profileData(User $user, string $view, ?int $selectedFlightId = null) : array {
|
public function profileData(User $user, string $view, ?int $selectedFlightId = null) : array {
|
||||||
return [
|
return [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'canEdit' => (auth()->check() && auth()->id() === $user->id) || auth()->user()->hasRole('admin'),
|
'canEdit' => (auth()->check() && auth()->id() === $user->id) || (auth()->check() && auth()->user()->hasRole('admin')),
|
||||||
'initialView' => $view,
|
'initialView' => $view,
|
||||||
'selectedFlightId' => $selectedFlightId,
|
'selectedFlightId' => $selectedFlightId,
|
||||||
'flight_api_url' => self::getUserFlightApiURL($user),
|
'flight_api_url' => self::getUserFlightApiURL($user),
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Settings\SettingsRegistry;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SettingsController extends Controller
|
||||||
|
{
|
||||||
|
public function show(Request $request)
|
||||||
|
{
|
||||||
|
$user = $request->user();
|
||||||
|
$current = array_merge(SettingsRegistry::defaults(), $user->settings ?? []);
|
||||||
|
$schema = SettingsRegistry::schema();
|
||||||
|
|
||||||
|
$fields = array_map(fn($field) => array_merge($field, [
|
||||||
|
'value' => $current[$field['key']] ?? $field['default'],
|
||||||
|
]), $schema);
|
||||||
|
|
||||||
|
return response()->json(['fields' => $fields]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request)
|
||||||
|
{
|
||||||
|
$validated = $request->validate(SettingsRegistry::validationRules());
|
||||||
|
$request->user()->updateSettings($validated['settings']);
|
||||||
|
return response()->json(['message' => 'Settings saved.']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,9 +5,11 @@ namespace App\Http\Controllers;
|
|||||||
use App\Models\Followee;
|
use App\Models\Followee;
|
||||||
use App\Models\Notification;
|
use App\Models\Notification;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Settings\SettingsRegistry;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Inertia\Inertia;
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
@@ -37,4 +39,17 @@ class UserController extends Controller
|
|||||||
|
|
||||||
return response()->json(['following' => true]);
|
return response()->json(['following' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function settings(){
|
||||||
|
$user = auth()->user();
|
||||||
|
$current = array_merge(SettingsRegistry::defaults(), $user->settings ?? []);
|
||||||
|
$fields = array_map(fn($field) => array_merge($field, [
|
||||||
|
'value' => $current[$field['key']] ?? $field['default'],
|
||||||
|
]), SettingsRegistry::schema());
|
||||||
|
|
||||||
|
return Inertia::render('UserSettings', [
|
||||||
|
'fields' => $fields,
|
||||||
|
'categories' => SettingsRegistry::categories(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,13 @@ class Airline extends Model
|
|||||||
protected function logoUrl() : Attribute{
|
protected function logoUrl() : Attribute{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: function () {
|
get: function () {
|
||||||
return config('app.logo_api_url') . "/airline/$this->internal_name/logo/tail";
|
$user = auth()->user();
|
||||||
|
$apiUrl = config('app.logo_api_url');
|
||||||
|
if ($user && !$user->getSetting('ai_tail_logos')) {
|
||||||
|
return $apiUrl .'/airline/blank/logo/tail';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $apiUrl . "/airline/$this->internal_name/logo/tail";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-13
@@ -3,9 +3,11 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Http\Controllers\UserFlightController;
|
use App\Http\Controllers\UserFlightController;
|
||||||
|
use App\Settings\SettingsRegistry;
|
||||||
use Database\Factories\UserFactory;
|
use Database\Factories\UserFactory;
|
||||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||||
use Illuminate\Database\Eloquent\Attributes\Hidden;
|
use Illuminate\Database\Eloquent\Attributes\Hidden;
|
||||||
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
@@ -13,7 +15,7 @@ use App\Traits\HasAchievements;
|
|||||||
use Laravel\Sanctum\HasApiTokens;
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
use Spatie\Permission\Traits\HasRoles;
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
|
|
||||||
#[Fillable(['name', 'email', 'password', 'distance_unit'])]
|
#[Fillable(['name', 'email', 'password', 'distance_unit', 'settings'])]
|
||||||
#[Hidden(['password', 'remember_token'])]
|
#[Hidden(['password', 'remember_token'])]
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
@@ -21,24 +23,38 @@ class User extends Authenticatable
|
|||||||
/** @use HasFactory<UserFactory> */
|
/** @use HasFactory<UserFactory> */
|
||||||
use HasFactory, HasAchievements, HasApiTokens, HasRoles;
|
use HasFactory, HasAchievements, HasApiTokens, HasRoles;
|
||||||
|
|
||||||
/**
|
protected $casts = [
|
||||||
* Get the attributes that should be cast.
|
'email_verified_at' => 'datetime',
|
||||||
*
|
'password' => 'hashed',
|
||||||
* @return array<string, string>
|
'settings' => 'array',
|
||||||
*/
|
];
|
||||||
protected function casts(): array
|
|
||||||
{
|
protected $appends = ['resolved_settings'];
|
||||||
return [
|
|
||||||
'email_verified_at' => 'datetime',
|
|
||||||
'password' => 'hashed',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function achievements(): HasMany
|
public function achievements(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(UserAchievement::class);
|
return $this->hasMany(UserAchievement::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSetting(string $key): mixed
|
||||||
|
{
|
||||||
|
$defaults = SettingsRegistry::defaults();
|
||||||
|
return $this->settings[$key] ?? $defaults[$key] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateSettings(array $values): void
|
||||||
|
{
|
||||||
|
$current = array_merge(SettingsRegistry::defaults(), $this->settings ?? []);
|
||||||
|
$this->update(['settings' => array_merge($current, $values)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function resolvedSettings(): Attribute
|
||||||
|
{
|
||||||
|
return Attribute::make(
|
||||||
|
get: fn() => array_merge(SettingsRegistry::defaults(), $this->settings ?? [])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function unlockedAchievements(): HasMany
|
public function unlockedAchievements(): HasMany
|
||||||
{
|
{
|
||||||
return $this->achievements()
|
return $this->achievements()
|
||||||
|
|||||||
@@ -227,6 +227,10 @@ class UserFlight extends Model
|
|||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: function () {
|
get: function () {
|
||||||
|
|
||||||
|
$user = auth()?->user();
|
||||||
|
|
||||||
|
$useAi = !$user || $user->getSetting('ai_liveries');
|
||||||
|
|
||||||
$apiUrl = config('app.logo_api_url');
|
$apiUrl = config('app.logo_api_url');
|
||||||
|
|
||||||
if (!$this->aircraft) {
|
if (!$this->aircraft) {
|
||||||
@@ -234,7 +238,7 @@ class UserFlight extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->airline){
|
if ($this->airline && $useAi){
|
||||||
$path = "images/liveries/{$this->airline->internal_name}_{$this->aircraft->designator}.png";
|
$path = "images/liveries/{$this->airline->internal_name}_{$this->aircraft->designator}.png";
|
||||||
if (Storage::disk('local')->exists($path)) {
|
if (Storage::disk('local')->exists($path)) {
|
||||||
$finalPath = $apiUrl."/airline/{$this->airline->internal_name}/livery/{$this->aircraft->designator}";
|
$finalPath = $apiUrl."/airline/{$this->airline->internal_name}/livery/{$this->aircraft->designator}";
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Settings;
|
||||||
|
|
||||||
|
class SettingsRegistry
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function categories(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'Units of Measurement' => 'Select either metric or incorrect units.',
|
||||||
|
'FlightsGoneBy Settings' => 'Settings for Site Behaviour',
|
||||||
|
'AI Generated Content' => 'Airline tail logos and liveries are AI generated with human cleanup. If you would rather not see any AI, then our blank aircraft templates are human created.',
|
||||||
|
'Account & Privacy' => 'Everything to do with your account.',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function schema(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
[
|
||||||
|
'key' => 'distance_unit',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Distance Units',
|
||||||
|
'category' => 'Units of Measurement',
|
||||||
|
'default' => 'km',
|
||||||
|
'options' => [
|
||||||
|
['value' => 'km', 'label' => 'Kilometres (km)'],
|
||||||
|
['value' => 'mi', 'label' => 'Miles (mi)'],
|
||||||
|
['value' => 'nm', 'label' => 'Nautical miles (nm)'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'category' => 'Account & Privacy',
|
||||||
|
'key' => 'private_profile',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Account Privacy',
|
||||||
|
'default' => 'public',
|
||||||
|
'options' => [
|
||||||
|
['value' => 'public', 'label' => 'Public Profile Viewable By Everyone'],
|
||||||
|
['value' => 'private', 'label' => 'Private Profile Viewable Only By You and Your Approved Followers'],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 'default_login_page',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Default Page After Login',
|
||||||
|
'category' => 'FlightsGoneBy Settings',
|
||||||
|
'default' => 'feed_first',
|
||||||
|
'options' => [
|
||||||
|
['value' => 'feed_first', 'label' => 'Feed if Following People, Profile if Not'],
|
||||||
|
['value' => 'profile', 'label' => 'Your Profile'],
|
||||||
|
['value' => 'feed', 'label' => 'Your Feed'],
|
||||||
|
['value' => 'dashboard', 'label' => 'Your Dashboard'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 'default_profile_view',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Default View When Loading a Profile',
|
||||||
|
'category' => 'FlightsGoneBy Settings',
|
||||||
|
'default' => 'departure-board',
|
||||||
|
'options' => [
|
||||||
|
['value' => 'departure-board', 'label' => 'Departure Board'],
|
||||||
|
['value' => 'map', 'label' => 'Map'],
|
||||||
|
['value' => 'boarding-passes', 'label' => 'Boarding Passes'],
|
||||||
|
['value' => 'achievements', 'label' => 'Achievements'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'category' => 'AI Generated Content',
|
||||||
|
'key' => 'ai_liveries',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'label' => 'Show AI Generated Livery Images',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'category' => 'AI Generated Content',
|
||||||
|
'key' => 'ai_tail_logos',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'label' => 'Show AI Generated Tail Logos',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 'departure_board_columns',
|
||||||
|
'category' => 'FlightsGoneBy Settings',
|
||||||
|
'type' => 'multiselect',
|
||||||
|
'label' => 'Which columns to show on the Departure Board',
|
||||||
|
'default' => ['airline', 'flight_number', 'from', 'to', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined'],
|
||||||
|
'options' => [
|
||||||
|
['value' => 'airline', 'label' => 'Airline'],
|
||||||
|
['value' => 'flight_number', 'label' => 'Flight Number'],
|
||||||
|
['value' => 'from', 'label' => 'From'],
|
||||||
|
['value' => 'to', 'label' => 'To'],
|
||||||
|
['value' => 'departure_date', 'label' => 'Departure Date'],
|
||||||
|
['value' => 'departure_time', 'label' => 'Departure Time'],
|
||||||
|
['value' => 'arrival_time', 'label' => 'Arrival Time'],
|
||||||
|
['value' => 'duration', 'label' => 'Duration'],
|
||||||
|
['value' => 'distance', 'label' => 'Distance'],
|
||||||
|
['value' => 'aircraft', 'label' => 'Aircraft'],
|
||||||
|
['value' => 'registration', 'label' => 'Aircraft Registration'],
|
||||||
|
['value' => 'class_seat_combined', 'label' => 'Class/Seat Type/Seat Number Combined'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function defaults(): array
|
||||||
|
{
|
||||||
|
return collect(static::schema())
|
||||||
|
->pluck('default', 'key')
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function validationRules(): array
|
||||||
|
{
|
||||||
|
$rules = [];
|
||||||
|
foreach (static::schema() as $field) {
|
||||||
|
$key = "settings.{$field['key']}";
|
||||||
|
$rules[$key] = match ($field['type']) {
|
||||||
|
'select' => ['required', 'string', 'in:' . implode(',', array_column($field['options'], 'value'))],
|
||||||
|
'checkbox' => ['boolean'],
|
||||||
|
'text' => ['nullable', 'string', 'max:255'],
|
||||||
|
'multiselect' => ['nullable', 'array'],
|
||||||
|
"settings.{$field['key']}.*" => ['string'],
|
||||||
|
default => ['nullable'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,11 +9,13 @@ return new class extends Migration
|
|||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*/
|
*/
|
||||||
|
// database/migrations/xxxx_add_settings_to_users_table.php
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
//
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->json('settings')->nullable()->after('password');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -53,6 +53,13 @@ function formatEngineType(type: string): string {
|
|||||||
<div class="tooltip-rows" v-if="flight?.livery_url">
|
<div class="tooltip-rows" v-if="flight?.livery_url">
|
||||||
<LiveryImage :flight="flight" />
|
<LiveryImage :flight="flight" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tooltip-divider" v-if="flight?.aircraft_registration" />
|
||||||
|
<div class="tooltip-rows" v-if="flight?.aircraft_registration">
|
||||||
|
<div class="tooltip-row">
|
||||||
|
<span class="tooltip-label">Registration</span>
|
||||||
|
<span class="tooltip-value">{{ flight.aircraft_registration}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</GlassTooltip>
|
</GlassTooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {Flight, User} from "@/Types/types";
|
import {Flight, SharedProps, User} from "@/Types/types";
|
||||||
import { computed, ref, watch, nextTick } from "vue";
|
import { computed, ref, watch, nextTick } from "vue";
|
||||||
import type { DataTableSortItem } from 'vuetify';
|
import type { DataTableSortItem } from 'vuetify';
|
||||||
import {FlightStats} from "@/Composables/useFlightStats";
|
import {FlightStats} from "@/Composables/useFlightStats";
|
||||||
import DepartureBoardTableRow from "@/Components/FlightsGoneBy/DepartureBoardTableRow.vue";
|
import DepartureBoardTableRow from "@/Components/FlightsGoneBy/DepartureBoardTableRow.vue";
|
||||||
|
import {usePage} from "@inertiajs/vue3";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
flightStats: FlightStats
|
flightStats: FlightStats
|
||||||
@@ -12,24 +13,34 @@ const props = defineProps<{
|
|||||||
flightId?: number | null
|
flightId?: number | null
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
|
||||||
|
const page = usePage<SharedProps>().props
|
||||||
const ITEMS_PER_PAGE = 25
|
const ITEMS_PER_PAGE = 25
|
||||||
|
|
||||||
const headers = [
|
const defaultColumns = ['airline', 'flight_number', 'from', 'to', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined']
|
||||||
|
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
|
||||||
|
const showColumn = (column: string) => columnsToShow.value.includes(column)
|
||||||
|
|
||||||
|
const allHeaders = [
|
||||||
{ title: '', key: 'airline', sortable: true },
|
{ title: '', key: 'airline', sortable: true },
|
||||||
{ title: 'FLIGHT', key: 'flight_number', sortable: true },
|
{ title: 'FLIGHT', key: 'flight_number', sortable: true },
|
||||||
{ title: 'FROM', key: 'departure_airport', sortable: true },
|
{ title: 'FROM', key: 'from', sortable: true },
|
||||||
{ title: 'TO', key: 'arrival_airport', sortable: true },
|
{ title: 'TO', key: 'to', sortable: true },
|
||||||
{ title: 'DATE', key: 'departure_date', sortable: true },
|
{ title: 'DATE', key: 'departure_date', sortable: true },
|
||||||
{ title: 'DEPART', key: 'departure_time_display', sortable: false },
|
{ title: 'DEPART', key: 'departure_time', sortable: false },
|
||||||
{ title: 'ARRIVE', key: 'arrival_time_display', sortable: false },
|
{ title: 'ARRIVE', key: 'arrival_time', sortable: false },
|
||||||
{ title: 'DURATION', key: 'duration', sortable: true },
|
{ title: 'DURATION', key: 'duration', sortable: true },
|
||||||
{ title: 'DISTANCE', key: 'distance', sortable: true },
|
{ title: 'DISTANCE', key: 'distance', sortable: true },
|
||||||
{ title: 'AIRCRAFT', key: 'aircraft.designator', sortable: true },
|
{ title: 'AIRCRAFT', key: 'aircraft', sortable: true },
|
||||||
{ title: 'REG', key: 'aircraft_registration', sortable: true },
|
{ title: 'REG', key: 'registration', sortable: true },
|
||||||
{ title: 'CLASS', key: 'flight_class', sortable: true },
|
{ title: 'CLASS', key: 'class_seat_combined', sortable: true },
|
||||||
{ title: '', key: 'actions', sortable: false },
|
{ title: '', key: 'actions', sortable: false },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const headers = computed(() =>
|
||||||
|
allHeaders.filter(h => h.key === 'actions' || showColumn(h.key))
|
||||||
|
)
|
||||||
|
|
||||||
const CLASS_ORDER: Record<string, number> = {
|
const CLASS_ORDER: Record<string, number> = {
|
||||||
'Unspecified': 0,
|
'Unspecified': 0,
|
||||||
'Economy': 1,
|
'Economy': 1,
|
||||||
@@ -40,7 +51,7 @@ const CLASS_ORDER: Record<string, number> = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const customKeySort = {
|
const customKeySort = {
|
||||||
flight_class: (a: Flight['flight_class'], b: Flight['flight_class']) => {
|
class_seat_combined: (a: Flight['flight_class'], b: Flight['flight_class']) => {
|
||||||
return (CLASS_ORDER[a?.name ?? ''] ?? -1) - (CLASS_ORDER[b?.name ?? ''] ?? -1)
|
return (CLASS_ORDER[a?.name ?? ''] ?? -1) - (CLASS_ORDER[b?.name ?? ''] ?? -1)
|
||||||
},
|
},
|
||||||
airline: (a: Flight['airline'], b: Flight['airline']) => {
|
airline: (a: Flight['airline'], b: Flight['airline']) => {
|
||||||
@@ -123,6 +134,7 @@ watch(
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -160,6 +172,7 @@ watch(
|
|||||||
|
|
||||||
<template v-else-if="!(item as any)._groupHeader">
|
<template v-else-if="!(item as any)._groupHeader">
|
||||||
<DepartureBoardTableRow
|
<DepartureBoardTableRow
|
||||||
|
:columnsToShow="columnsToShow"
|
||||||
:flight="(item as Flight)"
|
:flight="(item as Flight)"
|
||||||
:user="user"
|
:user="user"
|
||||||
:can-edit="canEdit"
|
:can-edit="canEdit"
|
||||||
|
|||||||
@@ -20,9 +20,12 @@ const props = defineProps<{
|
|||||||
highlighted?: boolean
|
highlighted?: boolean
|
||||||
group?: 'upcoming' | 'departed'
|
group?: 'upcoming' | 'departed'
|
||||||
isSorting?: boolean
|
isSorting?: boolean
|
||||||
|
columnsToShow: string[]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const page = usePage<SharedProps>()
|
const page = usePage<SharedProps>()
|
||||||
|
const showColumn = (column: string) => props.columnsToShow.includes(column)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -34,11 +37,11 @@ const page = usePage<SharedProps>()
|
|||||||
]"
|
]"
|
||||||
:data-flight-id="flight.id"
|
:data-flight-id="flight.id"
|
||||||
>
|
>
|
||||||
<td class="v-data-table__td airline-logo-cell">
|
<td v-if="showColumn('airline')" class="v-data-table__td airline-logo-cell">
|
||||||
<AirlineLogo size="32" :airline="flight.airline" class="airline-logo-img" />
|
<AirlineLogo size="32" :airline="flight.airline" class="airline-logo-img" />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td flight-number-cell">
|
<td v-if="showColumn('flight_number')" class="v-data-table__td flight-number-cell">
|
||||||
<div class="flight-cell">
|
<div class="flight-cell">
|
||||||
<Mono class="flight-number">
|
<Mono class="flight-number">
|
||||||
{{ flight.flight_number }}
|
{{ flight.flight_number }}
|
||||||
@@ -46,56 +49,56 @@ const page = usePage<SharedProps>()
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td">
|
<td v-if="showColumn('from')" class="v-data-table__td">
|
||||||
<AirportToolTip :airport="flight.departure_airport">
|
<AirportToolTip :airport="flight.departure_airport">
|
||||||
<Mono class="iata">{{ flight.departure_airport.display_code }}</Mono><br/>
|
<Mono class="iata">{{ flight.departure_airport.display_code }}</Mono><br/>
|
||||||
</AirportToolTip>
|
</AirportToolTip>
|
||||||
<span class="city-name">{{ flight.departure_airport.municipality }}</span>
|
<span class="city-name">{{ flight.departure_airport.municipality }}</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td">
|
<td v-if="showColumn('to')" class="v-data-table__td">
|
||||||
<AirportToolTip :airport="flight.arrival_airport">
|
<AirportToolTip :airport="flight.arrival_airport">
|
||||||
<span class="iata"><Mono>{{ flight.arrival_airport.display_code }}</Mono></span><br/>
|
<span class="iata"><Mono>{{ flight.arrival_airport.display_code }}</Mono></span><br/>
|
||||||
</AirportToolTip>
|
</AirportToolTip>
|
||||||
<span class="city-name" >{{ flight.arrival_airport.municipality }}</span>
|
<span class="city-name" >{{ flight.arrival_airport.municipality }}</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td">
|
<td v-if="showColumn('departure_date')" class="v-data-table__td">
|
||||||
<span class="date-cell"><Mono muted smaller>{{ flight.departure_date_display }}</Mono></span>
|
<span class="date-cell"><Mono muted smaller>{{ flight.departure_date_display }}</Mono></span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td">
|
<td v-if="showColumn('departure_time')" class="v-data-table__td">
|
||||||
<span class="time-cell">
|
<span class="time-cell">
|
||||||
<Mono small>{{ flight.departure_time_display }}</Mono>
|
<Mono small>{{ flight.departure_time_display }}</Mono>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td arrival-time-cell">
|
<td v-if="showColumn('arrival_time')" class="v-data-table__td arrival-time-cell">
|
||||||
<Mono small>{{ flight.arrival_time_display }}</Mono>
|
<Mono small>{{ flight.arrival_time_display }}</Mono>
|
||||||
<DayDifference :value="flight.arrival_day_difference" />
|
<DayDifference :value="flight.arrival_day_difference" />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td duration-cell">
|
<td v-if="showColumn('duration')" class="v-data-table__td duration-cell">
|
||||||
<Mono muted small>{{ flight.duration_display ?? '—' }}</Mono>
|
<Mono muted small>{{ flight.duration_display ?? '—' }}</Mono>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td distance-cell">
|
<td v-if="showColumn('distance')" class="v-data-table__td distance-cell">
|
||||||
<Mono muted small>
|
<Mono muted small>
|
||||||
<Distance :unit="page.props.auth.user?.distance_unit" :value="Math.round(flight.distance)" />
|
<Distance :unit="page.props.auth.user?.resolved_settings?.distance_unit" :value="Math.round(flight.distance)" />
|
||||||
</Mono>
|
</Mono>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td aircraft-cell">
|
<td v-if="showColumn('aircraft')" class="v-data-table__td aircraft-cell">
|
||||||
<AircraftToolTip v-if="flight.aircraft" :aircraft="flight.aircraft" :flight="flight">
|
<AircraftToolTip v-if="flight.aircraft" :aircraft="flight.aircraft" :flight="flight">
|
||||||
<Mono muted small>{{ flight.aircraft?.designator }}</Mono>
|
<Mono muted small>{{ flight.aircraft?.designator }}</Mono>
|
||||||
</AircraftToolTip>
|
</AircraftToolTip>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td registration-cell">
|
<td v-if="showColumn('registration')" class="v-data-table__td registration-cell">
|
||||||
<Mono muted smaller v-if="flight.aircraft_registration">{{ flight.aircraft_registration }}</Mono>
|
<Mono muted smaller v-if="flight.aircraft_registration">{{ flight.aircraft_registration }}</Mono>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td class-badges-cell">
|
<td v-if="showColumn('class_seat_combined')" class="v-data-table__td class-badges-cell">
|
||||||
<span class="class-cell">
|
<span class="class-cell">
|
||||||
<CrewTooltip v-if="flight.flight_reason?.name == 'Crew'" :crew-type="flight.crew_type!">
|
<CrewTooltip v-if="flight.flight_reason?.name == 'Crew'" :crew-type="flight.crew_type!">
|
||||||
<FlightClassBadge v-if="flight.flight_class?.internal_name === 'crew'" :flight="flight" />
|
<FlightClassBadge v-if="flight.flight_class?.internal_name === 'crew'" :flight="flight" />
|
||||||
|
|||||||
@@ -35,12 +35,12 @@
|
|||||||
<div class="stat">
|
<div class="stat">
|
||||||
<template v-if="totalDistanceKm">
|
<template v-if="totalDistanceKm">
|
||||||
<div class="stat-primary">
|
<div class="stat-primary">
|
||||||
<span class="stat-num"><Distance :unit="page.auth?.user?.distance_unit" includeSpace :value="totalDistanceKm" /></span>
|
<span class="stat-num"><Distance :unit="page.auth?.user?.resolved_settings?.distance_unit" includeSpace :value="totalDistanceKm" /></span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="upcomingDistanceKm">
|
<template v-if="upcomingDistanceKm">
|
||||||
<div :class="totalDistanceKm ? 'stat-upcoming' : 'stat-primary'">
|
<div :class="totalDistanceKm ? 'stat-upcoming' : 'stat-primary'">
|
||||||
<span :class="totalDistanceKm ? 'stat-upcoming-num' : 'stat-num'"><Distance :unit="page.auth?.user?.distance_unit" includeSpace :value="upcomingDistanceKm"/></span>
|
<span :class="totalDistanceKm ? 'stat-upcoming-num' : 'stat-num'"><Distance :unit="page.auth?.user?.resolved_settings?.distance_unit" includeSpace :value="upcomingDistanceKm"/></span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ onUnmounted(() => document.removeEventListener('click', handleClickOutside))
|
|||||||
</button>
|
</button>
|
||||||
<div v-if="dropdownOpen" class="dropdown-menu">
|
<div v-if="dropdownOpen" class="dropdown-menu">
|
||||||
<Link :href="route('import.fr24')" class="dropdown-item">Import from FR24</Link>
|
<Link :href="route('import.fr24')" class="dropdown-item">Import from FR24</Link>
|
||||||
|
<Link :href="route('profile.settings')" class="dropdown-item">Settings</Link>
|
||||||
<div class="dropdown-divider" />
|
<div class="dropdown-divider" />
|
||||||
<button class="dropdown-item dropdown-item--danger" @click="logout">Log Out</button>
|
<button class="dropdown-item dropdown-item--danger" @click="logout">Log Out</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -76,6 +77,7 @@ onUnmounted(() => document.removeEventListener('click', handleClickOutside))
|
|||||||
<Link :href="route('profile.view', { user: props.auth.user.name })" class="nav-link" @click="menuOpen = false">Profile</Link>
|
<Link :href="route('profile.view', { user: props.auth.user.name })" class="nav-link" @click="menuOpen = false">Profile</Link>
|
||||||
<Link :href="route('feed')" class="nav-link nav-link" @click="menuOpen = false">Feed</Link>
|
<Link :href="route('feed')" class="nav-link nav-link" @click="menuOpen = false">Feed</Link>
|
||||||
<Link :href="route('import.fr24')" class="nav-link" @click="menuOpen = false">Import from FR24</Link>
|
<Link :href="route('import.fr24')" class="nav-link" @click="menuOpen = false">Import from FR24</Link>
|
||||||
|
<Link :href="route('profile.settings')" class="nav-link" @click="menuOpen = false">Settings</Link>
|
||||||
<div class="dropdown-divider" />
|
<div class="dropdown-divider" />
|
||||||
<button class="nav-link nav-link--danger" @click="logout">Log Out</button>
|
<button class="nav-link nav-link--danger" @click="logout">Log Out</button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
|
|
||||||
import DeleteUserForm from './Partials/DeleteUserForm.vue';
|
|
||||||
import UpdatePasswordForm from './Partials/UpdatePasswordForm.vue';
|
|
||||||
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm.vue';
|
|
||||||
import { Head } from '@inertiajs/vue3';
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
mustVerifyEmail: {
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Head title="Profile" />
|
|
||||||
|
|
||||||
<AuthenticatedLayout>
|
|
||||||
<template #header>
|
|
||||||
<h2
|
|
||||||
class="text-xl font-semibold leading-tight text-gray-800"
|
|
||||||
>
|
|
||||||
Profile
|
|
||||||
</h2>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<div class="py-12">
|
|
||||||
<div class="mx-auto max-w-7xl space-y-6 sm:px-6 lg:px-8">
|
|
||||||
<div
|
|
||||||
class="bg-white p-4 shadow sm:rounded-lg sm:p-8"
|
|
||||||
>
|
|
||||||
<UpdateProfileInformationForm
|
|
||||||
:must-verify-email="mustVerifyEmail"
|
|
||||||
:status="status"
|
|
||||||
class="max-w-xl"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="bg-white p-4 shadow sm:rounded-lg sm:p-8"
|
|
||||||
>
|
|
||||||
<UpdatePasswordForm class="max-w-xl" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="bg-white p-4 shadow sm:rounded-lg sm:p-8"
|
|
||||||
>
|
|
||||||
<DeleteUserForm class="max-w-xl" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</AuthenticatedLayout>
|
|
||||||
</template>
|
|
||||||
@@ -107,7 +107,7 @@ const filteredUnlockedCount = computed(() =>
|
|||||||
:key="achievement.id"
|
:key="achievement.id"
|
||||||
:achievement="achievement"
|
:achievement="achievement"
|
||||||
:user-achievement="userAchievements[achievement.id]"
|
:user-achievement="userAchievements[achievement.id]"
|
||||||
:distance-unit="page.auth?.user?.distance_unit"
|
:distance-unit="page.auth?.user?.resolved_settings?.distance_unit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { reactive, ref, computed } from 'vue'
|
||||||
|
import axios from 'axios'
|
||||||
|
import MainLayout from "@/Layouts/MainLayout.vue"
|
||||||
|
import GlassBox from "@/Components/FlightsGoneBy/GlassBox.vue"
|
||||||
|
import { Head } from "@inertiajs/vue3"
|
||||||
|
import {SettingField} from "@/Types/types";
|
||||||
|
defineOptions({ layout: MainLayout })
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
fields: SettingField[],
|
||||||
|
categories: Record<string, string>
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const values = reactive(
|
||||||
|
Object.fromEntries(props.fields.map(f => [f.key, f.value]))
|
||||||
|
)
|
||||||
|
const saving = ref(false)
|
||||||
|
const saved = ref(false)
|
||||||
|
const error = ref(false)
|
||||||
|
|
||||||
|
const groupedFields = computed(() =>
|
||||||
|
props.fields.reduce((groups: Record<string, SettingField[]>, field) => {
|
||||||
|
const cat = field.category ?? 'General'
|
||||||
|
;(groups[cat] ??= []).push(field)
|
||||||
|
return groups
|
||||||
|
}, {} as Record<string, SettingField[]>)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async function save() {
|
||||||
|
saving.value = true
|
||||||
|
error.value = false
|
||||||
|
try {
|
||||||
|
await axios.patch('/settings', { settings: values })
|
||||||
|
saved.value = true
|
||||||
|
setTimeout(() => saved.value = false, 3000)
|
||||||
|
} catch {
|
||||||
|
error.value = true
|
||||||
|
} finally {
|
||||||
|
saving.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Head title="Settings" />
|
||||||
|
<GlassBox title="Your Settings">
|
||||||
|
<v-form @submit.prevent="save">
|
||||||
|
<template v-for="(groupFields, category) in groupedFields" :key="category">
|
||||||
|
<p class="text-overline text-medium-emphasis mb-1 mt-4">{{ category }}</p>
|
||||||
|
<small v-if="categories[category]" class="text-body-2 text-medium-emphasis mb-3">
|
||||||
|
{{ categories[category] }}
|
||||||
|
</small>
|
||||||
|
<v-divider class="mb-4" />
|
||||||
|
|
||||||
|
<template v-for="field in groupFields" :key="field.key">
|
||||||
|
|
||||||
|
<v-select
|
||||||
|
v-if="field.type === 'select'"
|
||||||
|
v-model="values[field.key]"
|
||||||
|
:label="field.label"
|
||||||
|
:items="field.options"
|
||||||
|
item-title="label"
|
||||||
|
item-value="value"
|
||||||
|
variant="outlined"
|
||||||
|
density="comfortable"
|
||||||
|
class="mb-2"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<v-text-field
|
||||||
|
v-else-if="field.type === 'text'"
|
||||||
|
v-model="values[field.key]"
|
||||||
|
:label="field.label"
|
||||||
|
variant="outlined"
|
||||||
|
density="comfortable"
|
||||||
|
class="mb-2"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<v-checkbox
|
||||||
|
v-else-if="field.type === 'checkbox'"
|
||||||
|
v-model="values[field.key]"
|
||||||
|
:label="field.label"
|
||||||
|
color="primary"
|
||||||
|
density="comfortable"
|
||||||
|
hide-details
|
||||||
|
class="mb-2"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<v-select
|
||||||
|
v-else-if="field.type === 'multiselect'"
|
||||||
|
v-model="values[field.key]"
|
||||||
|
:label="field.label"
|
||||||
|
:items="field.options"
|
||||||
|
item-title="label"
|
||||||
|
item-value="value"
|
||||||
|
variant="outlined"
|
||||||
|
density="comfortable"
|
||||||
|
chips
|
||||||
|
multiple
|
||||||
|
closable-chips
|
||||||
|
clearable
|
||||||
|
class="mb-2"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<v-divider class="my-4" />
|
||||||
|
|
||||||
|
<div class="d-flex align-center gap-3">
|
||||||
|
<v-btn
|
||||||
|
type="submit"
|
||||||
|
color="primary"
|
||||||
|
variant="elevated"
|
||||||
|
:loading="saving"
|
||||||
|
min-width="140"
|
||||||
|
>
|
||||||
|
Save settings
|
||||||
|
</v-btn>
|
||||||
|
|
||||||
|
<v-fade-transition>
|
||||||
|
<div v-if="saved" class="d-flex align-center gap-1 text-success">
|
||||||
|
<v-icon size="18">mdi-check-circle</v-icon>
|
||||||
|
<span class="text-body-2">Saved</span>
|
||||||
|
</div>
|
||||||
|
</v-fade-transition>
|
||||||
|
|
||||||
|
<v-fade-transition>
|
||||||
|
<div v-if="error" class="d-flex align-center gap-1 text-error">
|
||||||
|
<v-icon size="18">mdi-alert-circle</v-icon>
|
||||||
|
<span class="text-body-2">Something went wrong</span>
|
||||||
|
</div>
|
||||||
|
</v-fade-transition>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</v-form>
|
||||||
|
</GlassBox>
|
||||||
|
</template>
|
||||||
Vendored
+27
-1
@@ -17,7 +17,33 @@ export interface User {
|
|||||||
name: string
|
name: string
|
||||||
email: string
|
email: string
|
||||||
email_verified_at: string | null
|
email_verified_at: string | null
|
||||||
distance_unit: "km" | "mi" | "nm"
|
resolved_settings?: UserSettings
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DistanceUnit = "km" | "mi" | "nm"
|
||||||
|
|
||||||
|
export interface UserSettings {
|
||||||
|
distance_unit: DistanceUnit
|
||||||
|
show_ai_tail_logos: boolean
|
||||||
|
show_ai_livery_images: boolean
|
||||||
|
departure_board_columns: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export type SettingType = 'select' | 'text' | 'checkbox' | 'multiselect'
|
||||||
|
export interface SettingOption {
|
||||||
|
value: string
|
||||||
|
label: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SettingField {
|
||||||
|
key: keyof UserSettings
|
||||||
|
type: SettingType
|
||||||
|
label: string
|
||||||
|
category: string
|
||||||
|
default: UserSettings[keyof UserSettings]
|
||||||
|
value: UserSettings[keyof UserSettings]
|
||||||
|
options?: SettingOption[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UserActionType = "flight_cancelled" | "flight_booked" | "flight_updated" | "flight_logged" | "flight_deleted" | "flight_imported" | "flight_departing" | "flight_arriving"
|
export type UserActionType = "flight_cancelled" | "flight_booked" | "flight_updated" | "flight_logged" | "flight_deleted" | "flight_imported" | "flight_departing" | "flight_arriving"
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\SettingsController;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::get('/user', function (Request $request) {
|
Route::get('/user', function (Request $request) {
|
||||||
return $request->user();
|
return $request->user();
|
||||||
})->middleware('auth:sanctum');
|
})->middleware('auth:sanctum');
|
||||||
|
|
||||||
|
|
||||||
|
Route::middleware('auth:sanctum')->group(function () {
|
||||||
|
Route::get('/settings', [SettingsController::class, 'show']);
|
||||||
|
Route::patch('/settings', [SettingsController::class, 'update']);
|
||||||
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use App\Http\Controllers\LogoController;
|
|||||||
use App\Http\Controllers\NotificationController;
|
use App\Http\Controllers\NotificationController;
|
||||||
use App\Http\Controllers\ProfileController;
|
use App\Http\Controllers\ProfileController;
|
||||||
use App\Http\Controllers\SearchController;
|
use App\Http\Controllers\SearchController;
|
||||||
|
use App\Http\Controllers\SettingsController;
|
||||||
use App\Http\Controllers\UserController;
|
use App\Http\Controllers\UserController;
|
||||||
use App\Models\Airline;
|
use App\Models\Airline;
|
||||||
use App\Models\FlightClass;
|
use App\Models\FlightClass;
|
||||||
@@ -63,6 +64,9 @@ Route::domain(config('app.domain'))->group(
|
|||||||
|
|
||||||
Route::post('/u/{user}/follow', [UserController::class, 'follow'])->name('profile.follow');
|
Route::post('/u/{user}/follow', [UserController::class, 'follow'])->name('profile.follow');
|
||||||
|
|
||||||
|
Route::get('/settings', [UserController::class, 'settings'])->name('profile.settings');
|
||||||
|
Route::patch('/settings', [SettingsController::class, 'update'])->name('settings.update');
|
||||||
|
|
||||||
Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.get');
|
Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.get');
|
||||||
Route::patch('/notifications/{notification}/read', [NotificationController::class, 'markRead']);
|
Route::patch('/notifications/{notification}/read', [NotificationController::class, 'markRead']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user