From 02558d70f6ede19dcd3a4a5fe3db55d71152b0fb Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Sun, 15 Jan 2023 16:38:13 +0100 Subject: [PATCH] mobile nav --- app/Nova/Meetup.php | 23 +++++++++----- resources/lang/en.json | 3 +- resources/views/navigation-menu.blade.php | 38 ++++++++++++++++++++--- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/app/Nova/Meetup.php b/app/Nova/Meetup.php index 4cebf2ce..84e21102 100644 --- a/app/Nova/Meetup.php +++ b/app/Nova/Meetup.php @@ -5,32 +5,29 @@ namespace App\Nova; use App\Notifications\ModelCreatedNotification; use Ebess\AdvancedNovaMediaLibrary\Fields\Images; use Illuminate\Database\Eloquent\Model; -use Laravel\Nova\Fields\ID; use Illuminate\Http\Request; +use Laravel\Nova\Fields\BelongsTo; +use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Markdown; use Laravel\Nova\Fields\Text; -use Laravel\Nova\Fields\BelongsTo; use Laravel\Nova\Http\Requests\NovaRequest; class Meetup extends Resource { /** * The model the resource corresponds to. - * * @var string */ public static $model = \App\Models\Meetup::class; /** * The single value that should be used to represent the resource when being displayed. - * * @var string */ public static $title = 'name'; /** * The columns that should be searched. - * * @var array */ public static $search = [ @@ -56,12 +53,14 @@ class Meetup extends Resource * Get the fields displayed by the resource. * * @param \Illuminate\Http\Request $request + * * @return array */ public function fields(Request $request) { return [ - ID::make()->sortable(), + ID::make() + ->sortable(), Images::make(__('Logo'), 'logo') ->conversionOnIndexView('thumb'), @@ -74,7 +73,10 @@ class Meetup extends Resource Text::make('Link') ->rules('required', 'string'), - BelongsTo::make(__('City'), 'city', City::class)->searchable()->withSubtitles(), + BelongsTo::make(__('City'), 'city', City::class) + ->searchable() + ->withSubtitles() + ->help(__('If your city is not listed, please create it first.')), Markdown::make(__('Intro'), 'intro') ->help(__('This is the introduction text that is shown on the landing page.')), @@ -84,7 +86,8 @@ class Meetup extends Resource return $request->user() ->hasRole('super-admin'); }) - ->searchable()->withSubtitles(), + ->searchable() + ->withSubtitles(), ]; } @@ -93,6 +96,7 @@ class Meetup extends Resource * Get the cards available for the request. * * @param \Illuminate\Http\Request $request + * * @return array */ public function cards(Request $request) @@ -104,6 +108,7 @@ class Meetup extends Resource * Get the filters available for the resource. * * @param \Illuminate\Http\Request $request + * * @return array */ public function filters(Request $request) @@ -115,6 +120,7 @@ class Meetup extends Resource * Get the lenses available for the resource. * * @param \Illuminate\Http\Request $request + * * @return array */ public function lenses(Request $request) @@ -126,6 +132,7 @@ class Meetup extends Resource * Get the actions available for the resource. * * @param \Illuminate\Http\Request $request + * * @return array */ public function actions(Request $request) diff --git a/resources/lang/en.json b/resources/lang/en.json index 5a7d6be9..4007bb5c 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -628,5 +628,6 @@ "This is the subtitle on the landing page.": "", "Subtitle": "", "Intro": "", - "This lecturer has not yet written an introduction.": "" + "This lecturer has not yet written an introduction.": "", + "If your city is not listed, please create it first.": "" } diff --git a/resources/views/navigation-menu.blade.php b/resources/views/navigation-menu.blade.php index 2d4978b8..72a7e82d 100644 --- a/resources/views/navigation-menu.blade.php +++ b/resources/views/navigation-menu.blade.php @@ -68,7 +68,8 @@ @endif
- + {{ __('My profile') }} @@ -210,9 +211,38 @@