Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MuzafferDede committed Aug 8, 2021
1 parent 02b332e commit 9bcc542
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 77 deletions.
2 changes: 1 addition & 1 deletion dist/js/card.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"/js/card.js": "/js/card.js",
"/css/card.css": "/css/card.css"
"/js/card.js": "/js/card.js"
}
2 changes: 1 addition & 1 deletion resources/js/components/DateTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
minuteIncrement: this.minuteIncrement,
locale: { firstDayOfWeek: this.firstDayOfWeek },
mode: this.mode,
defaultDate: this.mode ? this.value.split('to') : this.value
defaultDate: this.mode && this.value ? this.value.split('to') : this.value
});
});
},
Expand Down
1 change: 0 additions & 1 deletion resources/sass/card.scss

This file was deleted.

19 changes: 0 additions & 19 deletions routes/api.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/CardServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Nemrutco\Filterable;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Laravel\Nova\Events\ServingNova;
use Laravel\Nova\Nova;
Expand All @@ -16,39 +15,8 @@ class CardServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->app->booted(function () {
$this->routes();
});

Nova::serving(function (ServingNova $event) {
Nova::script('filterable', __DIR__.'/../dist/js/card.js');
Nova::style('filterable', __DIR__.'/../dist/css/card.css');
});
}

/**
* Register the card's routes.
*
* @return void
*/
protected function routes()
{
if ($this->app->routesAreCached()) {
return;
}

Route::middleware(['nova'])
->prefix('nova-vendor/filterable')
->group(__DIR__.'/../routes/api.php');
}

/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
7 changes: 0 additions & 7 deletions src/Concerns/AppliesDefaultFilters.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Filterable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ public function applyFiltersToModel($request, $model)
$model = $filter->apply($request, $model, $request->input(get_class($filter)));
});

if ($this instanceof AppliesDefaultFilters) {
$filters->reject(static function ($filter) use ($request) {
return $request->input(get_class($filter)) || blank($filter->default());
})->map(static function ($filter) {
return [
'instance' => $filter,
'default' => $filter->default(),
];
})->where('default')->each(static function ($filter) use ($request, $model) {
$model = $filter['instance']->apply($request, $model, $filter['default']);
});
}

return $model;
}

Expand Down
1 change: 0 additions & 1 deletion webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ let mix = require('laravel-mix')
mix
.setPublicPath('dist')
.js('resources/js/card.js', 'js')
.sass('resources/sass/card.scss', 'css')
.webpackConfig({
resolve: {
symlinks: false,
Expand Down

0 comments on commit 9bcc542

Please sign in to comment.