Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bastihilger committed Feb 28, 2022
1 parent dd5aee1 commit e43938e
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$prefix = config('nova-cms-portfolio.db_prefix');

Schema::table($prefix.'categories', function (Blueprint $table) {
$table->unsignedInteger('main_image')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$prefix = config('nova-cms-portfolio.db_prefix');

Schema::table($prefix.'categories', function (Blueprint $table) {
$table->dropColumn('main_image');
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$prefix = config('nova-cms-portfolio.db_prefix');

Schema::table($prefix.'categories', function (Blueprint $table) {
$table->unsignedInteger('sort_order')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$prefix = config('nova-cms-portfolio.db_prefix');

Schema::table($prefix.'categories', function (Blueprint $table) {
$table->dropColumn('sort_order');
});
}
};
1 change: 1 addition & 0 deletions resources/lang/nova-cms-portfolio/de/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'category' => 'Kategorie',
'categories' => 'Kategorien',
'description' => 'Beschreibung',
'main_image' => 'Bild',
'show_in_home_navi' => 'In Home-Navigation zeigen',
'show_in_main_menu' => 'In Menü zeigen',
];
2 changes: 1 addition & 1 deletion resources/lang/nova-cms-portfolio/de/slideshows.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'starts_right' => 'Startet rechts in Übersicht',
'title' => 'Titel',
'toggle_is_published' => 'AN/AUS Veröffentlicht',
'toggle_visibility_in_artist_overview' => 'AN/AUS Sichtbarkein in Künstler-Überblick',
'toggle_visibility_in_artist_overview' => 'AN/AUS Sichtbarkeit in Künstler-Überblick',
'visible_in_artist_overview' => 'Sichtbar in Künstler-Überblick',
'zip_update_projects' => 'Projekte-Schnellupload als ZIP',
];
1 change: 1 addition & 0 deletions resources/lang/nova-cms-portfolio/en/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'category' => 'Category',
'categories' => 'Categories',
'description' => 'Description',
'main_image' => 'Bild',
'show_in_home_navi' => 'show in home navigation',
'show_in_main_menu' => 'show in menu',
];
6 changes: 6 additions & 0 deletions src/Nova/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Kraenkvisuell\NovaCmsPortfolio\Nova;

use Illuminate\Http\Request;
use Kraenkvisuell\NovaCmsMedia\MediaLibrary;
use Kraenkvisuell\NovaCmsPortfolio\Nova\Resource;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Text;
Expand Down Expand Up @@ -43,6 +44,8 @@ public static function singularLabel()

public function fields(Request $request)
{
$uploadOnly = config('nova-cms-portfolio.media.upload_only') ?: false;

return [

Text::make(__('nova-cms-portfolio::portfolio.title'), 'title')
Expand All @@ -52,6 +55,9 @@ public function fields(Request $request)
->translatable()
->help(__('nova-cms-portfolio::artists.slug_explanation')),

MediaLibrary::make(__('nova-cms-portfolio::categories.main_image'), 'main_image')
->uploadOnly($uploadOnly),

TipTap::make(__('nova-cms-portfolio::categories.description'), 'description')
->translatable()
->onlyOnForms(),
Expand Down

0 comments on commit e43938e

Please sign in to comment.