feat: Add Dynamics to main navigation
This commit is contained in:
parent
c31b4612df
commit
16a6962149
0
.ai/mcp/mcp.json
Normal file
0
.ai/mcp/mcp.json
Normal file
@ -5,7 +5,6 @@ namespace App\Events;
|
|||||||
use App\Models\Message;
|
use App\Models\Message;
|
||||||
use Illuminate\Broadcasting\Channel;
|
use Illuminate\Broadcasting\Channel;
|
||||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
use Illuminate\Broadcasting\PresenceChannel;
|
|
||||||
use Illuminate\Broadcasting\PrivateChannel;
|
use Illuminate\Broadcasting\PrivateChannel;
|
||||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
use Illuminate\Foundation\Events\Dispatchable;
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
|||||||
@ -5,9 +5,6 @@ namespace App\Http\Requests;
|
|||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
|
||||||
use App\Models\Dynamic;
|
|
||||||
|
|
||||||
class StoreLedgerRequest extends FormRequest
|
class StoreLedgerRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -23,7 +20,7 @@ class StoreLedgerRequest extends FormRequest
|
|||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
*
|
*
|
||||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
|
* @return array<string, ValidationRule|array|string>
|
||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,9 +5,6 @@ namespace App\Http\Requests;
|
|||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
|
||||||
use App\Models\Chat;
|
|
||||||
|
|
||||||
class StoreMessageRequest extends FormRequest
|
class StoreMessageRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -23,7 +20,7 @@ class StoreMessageRequest extends FormRequest
|
|||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
*
|
*
|
||||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
|
* @return array<string, ValidationRule|array|string>
|
||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,9 +5,6 @@ namespace App\Http\Requests;
|
|||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
|
||||||
use App\Models\Ledger;
|
|
||||||
|
|
||||||
class StoreMutationRequest extends FormRequest
|
class StoreMutationRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -23,7 +20,7 @@ class StoreMutationRequest extends FormRequest
|
|||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
*
|
*
|
||||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string>
|
* @return array<string, ValidationRule|array|string>
|
||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Database\Factories\ChatFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
@ -9,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|||||||
|
|
||||||
class Chat extends Model
|
class Chat extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\ChatFactory> */
|
/** @use HasFactory<ChatFactory> */
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
public function chatable(): MorphTo
|
public function chatable(): MorphTo
|
||||||
|
|||||||
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Database\Factories\DynamicFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||||
|
|
||||||
class Dynamic extends Model
|
class Dynamic extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\DynamicFactory> */
|
/** @use HasFactory<DynamicFactory> */
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Database\Factories\LedgerFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class Ledger extends Model
|
class Ledger extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\LedgerFactory> */
|
/** @use HasFactory<LedgerFactory> */
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Database\Factories\MessageFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class Message extends Model
|
class Message extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\MessageFactory> */
|
/** @use HasFactory<MessageFactory> */
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Database\Factories\MutationFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||||
|
|
||||||
class Mutation extends Model
|
class Mutation extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\MutationFactory> */
|
/** @use HasFactory<MutationFactory> */
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|||||||
@ -3,14 +3,10 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
use App\Models\Dynamic;
|
|
||||||
use App\Models\Mutation;
|
|
||||||
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\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|||||||
@ -4,7 +4,6 @@ namespace App\Policies;
|
|||||||
|
|
||||||
use App\Models\Dynamic;
|
use App\Models\Dynamic;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class DynamicPolicy
|
class DynamicPolicy
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Providers\AppServiceProvider;
|
||||||
|
use App\Providers\AuthServiceProvider;
|
||||||
|
use App\Providers\FortifyServiceProvider;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
App\Providers\AppServiceProvider::class,
|
AppServiceProvider::class,
|
||||||
App\Providers\AuthServiceProvider::class,
|
AuthServiceProvider::class,
|
||||||
App\Providers\FortifyServiceProvider::class,
|
FortifyServiceProvider::class,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Link } from '@inertiajs/vue3';
|
import { Link } from '@inertiajs/vue3';
|
||||||
import { BookOpen, FolderGit2, LayoutGrid } from '@lucide/vue';
|
import { BookOpen, FolderGit2, LayoutGrid, Users } from '@lucide/vue';
|
||||||
import AppLogo from '@/components/AppLogo.vue';
|
import AppLogo from '@/components/AppLogo.vue';
|
||||||
import NavFooter from '@/components/NavFooter.vue';
|
import NavFooter from '@/components/NavFooter.vue';
|
||||||
import NavMain from '@/components/NavMain.vue';
|
import NavMain from '@/components/NavMain.vue';
|
||||||
@ -15,6 +15,7 @@ import {
|
|||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
} from '@/components/ui/sidebar';
|
} from '@/components/ui/sidebar';
|
||||||
import { dashboard } from '@/routes';
|
import { dashboard } from '@/routes';
|
||||||
|
import { index as dynamics } from '@/routes/dynamics';
|
||||||
import type { NavItem } from '@/types';
|
import type { NavItem } from '@/types';
|
||||||
|
|
||||||
const mainNavItems: NavItem[] = [
|
const mainNavItems: NavItem[] = [
|
||||||
@ -23,6 +24,11 @@ const mainNavItems: NavItem[] = [
|
|||||||
href: dashboard(),
|
href: dashboard(),
|
||||||
icon: LayoutGrid,
|
icon: LayoutGrid,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Dynamics',
|
||||||
|
href: dynamics(),
|
||||||
|
icon: Users,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const footerNavItems: NavItem[] = [
|
const footerNavItems: NavItem[] = [
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Http\Controllers\MessageController;
|
|
||||||
use App\Http\Controllers\MutationController;
|
|
||||||
use App\Http\Controllers\DynamicController;
|
use App\Http\Controllers\DynamicController;
|
||||||
use App\Http\Controllers\LedgerController;
|
use App\Http\Controllers\LedgerController;
|
||||||
|
use App\Http\Controllers\MessageController;
|
||||||
|
use App\Http\Controllers\MutationController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::inertia('/', 'Welcome')->name('home');
|
Route::inertia('/', 'Welcome')->name('home');
|
||||||
|
|||||||
@ -74,4 +74,4 @@ test('users are rate limited', function () {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$response->assertTooManyRequests();
|
$response->assertTooManyRequests();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -98,4 +98,4 @@ test('already verified user visiting verification link is redirected without fir
|
|||||||
|
|
||||||
Event::assertNotDispatched(Verified::class);
|
Event::assertNotDispatched(Verified::class);
|
||||||
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
|
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -19,4 +19,4 @@ test('password confirmation requires authentication', function () {
|
|||||||
$response = $this->get(route('password.confirm'));
|
$response = $this->get(route('password.confirm'));
|
||||||
|
|
||||||
$response->assertRedirect(route('login'));
|
$response->assertRedirect(route('login'));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -75,4 +75,4 @@ test('password cannot be reset with invalid token', function () {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$response->assertSessionHasErrors('email');
|
$response->assertSessionHasErrors('email');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -22,4 +22,4 @@ test('new users can register', function () {
|
|||||||
|
|
||||||
$this->assertAuthenticated();
|
$this->assertAuthenticated();
|
||||||
$response->assertRedirect(route('dashboard', absolute: false));
|
$response->assertRedirect(route('dashboard', absolute: false));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -32,4 +32,4 @@ test('two factor challenge can be rendered', function () {
|
|||||||
->assertInertia(fn (Assert $page) => $page
|
->assertInertia(fn (Assert $page) => $page
|
||||||
->component('auth/TwoFactorChallenge'),
|
->component('auth/TwoFactorChallenge'),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -31,4 +31,4 @@ test('does not send verification notification if email is verified', function ()
|
|||||||
->assertRedirect(route('dashboard', absolute: false));
|
->assertRedirect(route('dashboard', absolute: false));
|
||||||
|
|
||||||
Notification::assertNothingSent();
|
Notification::assertNothingSent();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -13,4 +13,4 @@ test('authenticated users can visit the dashboard', function () {
|
|||||||
|
|
||||||
$response = $this->get(route('dashboard'));
|
$response = $this->get(route('dashboard'));
|
||||||
$response->assertOk();
|
$response->assertOk();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,4 +4,4 @@ test('returns a successful response', function () {
|
|||||||
$response = $this->get(route('home'));
|
$response = $this->get(route('home'));
|
||||||
|
|
||||||
$response->assertOk();
|
$response->assertOk();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -82,4 +82,4 @@ test('correct password must be provided to delete account', function () {
|
|||||||
->assertRedirect(route('profile.edit'));
|
->assertRedirect(route('profile.edit'));
|
||||||
|
|
||||||
expect($user->fresh())->not->toBeNull();
|
expect($user->fresh())->not->toBeNull();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -101,4 +101,4 @@ test('correct password must be provided to update password', function () {
|
|||||||
$response
|
$response
|
||||||
->assertSessionHasErrors('current_password')
|
->assertSessionHasErrors('current_password')
|
||||||
->assertRedirect(route('security.edit'));
|
->assertRedirect(route('security.edit'));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
test('that true is true', function () {
|
test('that true is true', function () {
|
||||||
expect(true)->toBeTrue();
|
expect(true)->toBeTrue();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user