Skip to content

Commit

Permalink
Merge branch 'main' into pr/188
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Jul 24, 2023
2 parents 36b062a + e2b4294 commit ccbfc2e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 35 deletions.
11 changes: 4 additions & 7 deletions src/Console/stubs/crud-controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ class DummyClassCrudController extends CrudController
*/
protected function setupListOperation()
{
CRUD::setFromDb(); // columns
CRUD::setFromDb(); // set columns from db columns.

/**
* Columns can be defined using the fluent syntax or array syntax:
* Columns can be defined using the fluent syntax:
* - CRUD::column('price')->type('number');
* - CRUD::addColumn(['name' => 'price', 'type' => 'number']);
*/
}

Expand All @@ -57,13 +56,11 @@ class DummyClassCrudController extends CrudController
protected function setupCreateOperation()
{
CRUD::setValidation(DummyClassRequest::class);

CRUD::setFromDb(); // fields
CRUD::setFromDb(); // set fields from db columns.

/**
* Fields can be defined using the fluent syntax or array syntax:
* Fields can be defined using the fluent syntax:
* - CRUD::field('price')->type('number');
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
*/
}

Expand Down
1 change: 0 additions & 1 deletion src/Console/stubs/crud-model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DummyClass extends Model
protected $guarded = ['id'];
// protected $fillable = [];
// protected $hidden = [];
// protected $dates = [];

/*
|--------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions src/Console/stubs/field.stub
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
{{-- CUSTOM CSS --}}
@push('crud_fields_styles')
{{-- How to load a CSS file? --}}
@loadOnce('dummyFieldStyle.css')
@basset('dummyFieldStyle.css')

{{-- How to add some CSS? --}}
@loadOnce('dummy_field_style')
@bassetBlock('backpack/crud/fields/dummy_field-style.css')
<style>
.dummy_field_class {
display: none;
}
</style>
@endLoadOnce
@endBassetBlock
@endpush

{{-- CUSTOM JS --}}
@push('crud_fields_scripts')
{{-- How to load a JS file? --}}
@loadOnce('dummyFieldScript.js')
@basset('dummyFieldScript.js')

{{-- How to add some JS to the field? --}}
@loadOnce('bpFieldInitDummyFieldElement')
@bassetBlock('path/to/script.js')
<script>
function bpFieldInitDummyFieldElement(element) {
// this function will be called on pageload, because it's
Expand All @@ -50,5 +50,5 @@
console.log(element.val());
}
</script>
@endLoadOnce
@endBassetBlock
@endpush
8 changes: 0 additions & 8 deletions src/Console/stubs/filter.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
{{-- ########################################### --}}
{{-- Extra CSS and JS for this particular filter --}}

{{-- FILTERS EXTRA CSS --}}
{{-- push things in the after_styles section --}}

{{-- @push('crud_list_styles')
no css
@endpush --}}


{{-- FILTERS EXTRA JS --}}
{{-- push things in the after_scripts section --}}

Expand Down
6 changes: 0 additions & 6 deletions src/Console/stubs/model-softdelete.stub
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class DummyClass extends Model
*/
// protected $hidden = [];

/**
* The attributes that should be mutated to dates.
*
* @var array
*/
// protected $dates = [];

/*
|--------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions src/Console/stubs/model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ class DummyClass extends Model
*/
// protected $hidden = [];

/**
* The attributes that should be mutated to dates.
*
* @var array
*/
// protected $dates = [];

/*
|--------------------------------------------------------------------------
| FUNCTIONS
Expand Down

0 comments on commit ccbfc2e

Please sign in to comment.