Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#tags').select2({
- placeholder: "Selecciona las etiquetas",
- ajax: {
- url: tagPublication,
- type: 'get',
- dataType: 'json',
- delay: 250,
- allowClear: true,
- data: function (params){
- return {
- term: params.term,
- };
- },
- processResults: function(data, params){
- return {
- results: data
- };
- },
- }
- });
- public function selectType()
- {
- $type = Type::all();
- $select = [];
- foreach ($type as $data) {
- $select[] = ["id" => $data->id, "text" => $data->type_name];
- }
- return response()->json($select);
- }
Add Comment
Please, Sign In to add comment