Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update stubs - remove $dates property, use basset, remove array syntax #199

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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