Generators
Generators copied to clipboard
Command to create a new field:
php artisan backpack:field {name}
Hi there!
Is this still an issue? No activity in 60 days. I'm going to mark it as stale for now, and close it in 14 days if no further activity occurs. I know you guys are all busy, but if this is important to you please reply or something, so I know not to close it.
Thank you!
-- Justin Case The Backpack Robot
Hi there!
Is this still an issue? No activity in 60 days. I'm going to mark it as stale for now, and close it in 14 days if no further activity occurs. I know you guys are all busy, but if this is important to you please reply or something, so I know not to close it.
Thank you!
-- Justin Case The Backpack Robot
Hi there!
Is this still an issue? No activity in 60 days. I'm going to mark it as stale for now, and close it in 14 days if no further activity occurs. I know you guys are all busy, but if this is important to you please reply or something, so I know not to close it.
Thank you!
-- Justin Case The Backpack Robot
Hi there!
Is this still an issue? No activity in 60 days. I'm going to mark it as stale for now, and close it in 14 days if no further activity occurs. I know you guys are all busy, but if this is important to you please reply or something, so I know not to close it.
Thank you!
-- Justin Case The Backpack Robot
bump
Hi there!
Is this still an issue? No activity in 60 days. I'm going to mark it as stale for now, and close it in 14 days if no further activity occurs. I know you guys are all busy, but if this is important to you please reply or something, so I know not to close it.
Thank you!
-- Justin Case The Backpack Robot
@karandatwani92 any chance you can take this on, too?
@tabacitu Yes, noted. We will have it soon.
@tabacitu I'm thinking of two types of action for field, column, filter & widget:
- php artisan backpack:field {name} for new plain file
- php artisan backpack:field {name} --backpack_field_name to copy view file with new name in case one wants modify and use if for own purpose as i did with webcam field?
what do you say?
I love it. But let's name the second one:
php artisan backpack:field {name} --from={source_field_name}
That should be easier to read, right?
Now that I think about it... a new empty file doesn't really make sense at all... You'd have to code everything from scratch... so perhaps a good starting point would be the text field.
You specify no --from => it creates it from TEXT
You specify a --from => it creates it from whatever you chose
What do you think @karandatwani92 ? Without an example... it would be really difficult to create a proper custom field. And I guess text is the best example.
My two cents here:
php artisan backpack:field {name} --from="any_field"
- Copy the provided field. Nothing to see here.
php artisan backpack:field {name}
- Create the field file from a stub similar to the text input but without all the suffix, hint, prefix stuff ... if you want text, use --from="text"
@include(wrapper_start)
<input type="text" />
@include(wrapper_end)
php artisan backpack:field {name}--withAssets
@include(wrapper_start)
<input type="text" data-init-function="bpFieldInitMyFieldElement" />
@include(wrapper_end)
@push('crud_fields_styles')
@loadOnce('your_field_name_field_style')
<style>
.your_field_class { display: none; }
</style>
@endLoadOnce
@endpush
@push('crud_fields_scripts')
@loadOnce(asset('myFieldScript.js')
@loadOnce('bpFieldInitMyFieldElement')
function bpFieldInitMyFieldElement(element) {
// element is the jquery wrapped element where init function is defined.
}
@endLoadOnce
@endpush
Even the empty stubs show alot on how the Backpack fields are structured, for me, much more understandable than looking at current field implementations and figure out the "story" on why things are there.
Cheers
Hmm... fair enough. Ok, I'm convinced, let's do it Pedro's way!
@tabacitu Please check. #144
Whoohooo! Let's move the conversation to https://github.com/Laravel-Backpack/Generators/pull/144 then 🎉 We're making progress!!!