adhik13th

adhik13th

Member Since 1 Year Ago

Experience Points
5,200
Total
Experience

4,800 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
1
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 2
5,200 XP
Aug
27
3 weeks ago
Activity icon

Replied to How To Loop Number And Saved Into Table Laravel

how to ad this ? i cant add this 0 string in the first

   if($first < 10){
       $data = '0'.$first + 1; // this is invalid and 0 cant be added ,helpp ???
    }
    elseif($first > 10){
        $data = $first + 1;
    }
Activity icon

Started a new Conversation How To Loop Number And Saved Into Table Laravel

I have input and this input is will generate number sequentially like this

5.01
5.02
5.03
......
5.10
5.11

i get number 5 on first number is from my another data . u can see at my code .so how i can do this if this number start from '01' not '1' and if more than 10 this '0' in first number is deleted.

in my controller i saved in $data and looping this number from 01 So in my input controller is like that :

 public function store(Request $request)
{   

    $data = $request['kode_induk'] + // i dont know what to do here for loop this input , 

    $induk = IndukBelanja::create([
       'user_id' => Auth::user()->id,
       'kode_induk' => $request['kode_induk'],
       'kode_rekening' => $data,
       'uraian' => $request['uraian'],
       'anggaran' => $request['anggaran'],
    ]);

    if ($induk) {
        return ['redirect' => route('rekening_induk')];
    } else {
        return response()->json([
            'success' => false,
            'message' => ' Gagal update!',
        ], 500);
    }
}

how i can loop this number ? can someone help ?

Update its my database what i need

+----+------------+------------+------------+
| id |kode_induk  |kode_rekening|   uraian
+----+------------+------------+------------+
|  1 |   5        |   5.01     |    some data   
+----+------------+------------+------------+
|  2 |   5        |   5.02     |    some data   
+----+------------+------------+------------+
|  3 |   5        |   5.03     |    some data 
+----+------------+------------+------------+
|  4 |   5        |   5.04     |    some data   
+----+------------+------------+------------+
Aug
11
1 month ago
Activity icon

Replied to How To Show Data In Relate Table Laravel

in my problem , i have input field using multiple input , i cant and i dont know how to save this on another table , its need like a trigger or what . i create a post on stackoverflow but i not have a answer . this post

https://stackoverflow.com/questions/62809167/how-to-save-sum-1-row-in-vue-js

Activity icon

Replied to How To Show Data In Relate Table Laravel

so u mean i need changed my parent table to save this total price ???

Activity icon

Replied to How To Show Data In Relate Table Laravel

but its on different table , my total is solved i just add sum function . but how to showing it in another table ?

Aug
07
1 month ago
Activity icon

Started a new Conversation How To Show Data In Relate Table Laravel

I have 3 table called category_order , order , order_detail . now i want to showing total_order in another table but its related table ,you can see this table like this :

category_order:

category_order
+----+------------+------------+------------+
| id |  cat_name  | balance    |    some_data
+----+------------+------------+------------+
|  1 |   phone    | 10000000   |    
+----+------------+------------+------------+
|  2 |     PC     | 50000000   |   
+----+------------+------------+------------+
|  3 | Electronic | 500000000  |    
+----+------------+------------+------------+

order:

order
+----+------------+------------+------------+
| id |  cat_id    |some_data   |    some_data
+----+------------+------------+------------+
|  1 |   1        | some_data  |    
+----+------------+------------+------------+
|  2 |   1        | some_data  |   
+----+------------+------------+------------+
|  3 |   2        | some_data  |    
+----+------------+------------+------------+

order_detail

order_detail
+----+------------+------------+------------+
| id |  order_id  | price      |   qty   
+----+------------+------------+------------+
|  1 |   1        |   1000     |    10   // so from this i can create total 10000
+----+------------+------------+------------+
|  2 |   1        |   2000     |    5    // and this 10000
+----+------------+------------+------------+
|  3 |   2        |   5000     |    10   // and this 50000
+----+------------+------------+------------+

this 3 table is related ,and now i want to show data like this :

category_order
+----+------------+------------+------------+
| id |  cat_name  |  balance   |   total_order
+----+------------+------------+------------+
|  1 |   phone    | 10000000   |    20000
+----+------------+------------+------------+
|  2 |     PC     | 50000000   |    50000
+----+------------+------------+------------+
|  3 | Electronic | 50000000   |    . . .  .
+----+------------+------------+------------+

and its my relation

 Models Order
    public function category_order()
    {
        return $this->belongsTo(\App\Models\CategoryOrder::class ,'cat_id');
    }

 Models Order_detail
    public function order()
    {
        return $this->belongsTo(\App\Models\Order::class ,'order_id');
    }

so what i can do for this ???

and my step now is just selecting on category_order like this :

 public function get_belanja()
    {
        $belanja = CategoryOrder::where('status', 'active')->get();
        return response()->json($belanja ,200);
    }
Aug
02
1 month ago
Activity icon

Replied to Digitally Signing Pdf File

hello can you show this results ???

Jul
22
1 month ago
Activity icon

Started a new Conversation How To Limit Data 10 Per Page On Table Jspdf Autotable

I want to limit only 10 data perpage on jspdf ,only 10 rows data on 1 page , but didnt work .

i always use this autoTableAddPage , but its didnt work , i references from this link ,

and its my code

 var res = doc.autoTableHtmlToJson(document.getElementById("basic-table"));     
  doc.autoTable(res.columns, res.data, {
     drawRow: function(row) {
        if (row.index > 0 && row.index % 10 === 0) {
           doc.autoTableAddPage();
         }
       }
  }, {margin: {top: 180},beforePageContent: header });

this data is showing but always more than 10 rows , whats wrong with this ? can someone help ?

Jul
21
1 month ago
Activity icon

Started a new Conversation How To Add Currency At Jspdf

i have a function currency money and i always use in vue blade like this

 <td>{{ price | currency}}</td>

and will showing like that :

Rp. 5.000.000 

now i using jspdf to export my price but i didnt know how to use this currency

 let totals = this.datatotal 
  ......
    doc.text(String(totals), 102, finalY + 75) // it will be showing 5000000 but i need 5.000.000

i try to

  doc.text(String(totals | currency), 102, finalY + 75) // 

but having error ReferenceError: currency is not defined"

someone can help for this ??

Jul
20
1 month ago
Activity icon

Started a new Conversation How To Add Dinamic Text Under Table In Jspdf

i have a pdf with table using jspdf autotable , i want to add some text dinamicly on under table. if the table has reached the bottom, then underneath there will be text as I want it right. the concept is like a footer but this is exactly below the table.

and its my code

 methods:{
downloadPDF(){
 var  addFooters = doc => {
 const pageCount = doc.internal.getNumberOfPages()

 doc.setFont('helvetica', 'italic')
 doc.setFontSize(8)
 for (var i = 1; i <= pageCount; i++) {
   doc.setPage(i)
   doc.text('Page ' + String(i) + ' of ' + String(pageCount), doc.internal.pageSize.width / 2, 587, {
   align: 'center'
    })
  }
 }
   
  var doc = new jsPDF('l', 'pt');

   var header = function (data) {
                doc.setFontSize(18);
                doc.setTextColor(40);
                doc.setFontStyle('normal');

               doc.text(330, 50, 'Pengajuan Pencairan')
              
              
            };
             doc.setFontSize(12)
             doc.text(75, 80, 'Nama Program')      
             doc.text(75, 100, 'Kegiatan')
             doc.text(75, 140, 'Rincian Kegiatan')
             doc.text(75, 160, 'Bulan Tanggal')


             doc.text(600, 80, 'Anggaran')
             doc.text(600, 100, 'Sudah Digunakan')
             doc.text(600, 140, 'Pengajuan')
             doc.text(600, 160, 'Sisa Anggaran')

 
  var res = doc.autoTableHtmlToJson(document.getElementById("basic-table"));     
  doc.autoTable(res.columns, res.data, {margin: {top: 180},  beforePageContent: header }); //table
  
  //here after this table i need add some dinamic text .

  addFooters(doc)
  doc.save("table.pdf");
}

}

i can use

doc.text(600, 80, 'blablabla')

but its not dinamic if i have long table

someone have solution for this ??

Jul
10
2 months ago
Activity icon

Replied to How To Loop Function In Computed

omg . i dont know why its not simple :( .

sir please see this , this is what i need but i dont know how i can save this price*qty .

https://codesandbox.io/s/stupefied-ardinghelli-lixl1?file=/src/components/HelloWorld.vue:36-241

Activity icon

Replied to How To Loop Function In Computed

sir i dont get it what u mean .

  <div class="field" v-for="data in userData" :key="data.id">
                        <div class="field-body">
                            
                        <div class="field">
                        <label class="label">Nama Barang: </label>
                        <p class="control is-expanded">
                            <input 
                            type="text"
                            name="nama_barang[]"
                            id="nama_barang"
                            class="input"
                            v-model="data.nama_barang"
                            placeholder="nama barang">
                        </p>
                        </div>
                        
                            <div class="field">
                            <label class="label">Satuan: </label>
                            <p class="control is-expanded">
                                <input 
                                type="text"
                                name="satuan[]"
                                id="satuan"
                                class="input"
                                v-model="data.satuan"
                                placeholder="Satuan">
                            </p>
                            </div>
                           
                            <div class="field">
                             <label class="label">Quantity:</label>
                            <p class="control is-expanded">
                                <input 
                                type="number"
                                name="qtt[]"
                                id="qtt"
                                class="input"
                                v-model="data.qtt"
                                placeholder="Qtt" >
                            </p>
                            </div>
                            
                            <div class="field">
                            <label class="label">Harga:{{ data.harga | currency}}</label>
                                <p class="control is-expanded">
                                    <input class="input" 
                                    name="harga[]"
                                    type="number"
                                    id="harga"
                                    v-model="data.harga"
                                    placeholder="Harga">
                                </p>
                            </div>

                            <div class="field">
                            <label class="label">Harga Total:</label>
                                <p class="control is-expanded">
                                    <span> {{totalItems | currency}}</span>
                                 
                                </p>
                            </div>
	</div>

its my input and where i can put this on change ? on my button add form ?

Activity icon

Started a new Conversation How To Loop Function In Computed

i have input data ,this input is multiple input and have button to add more field input , i have colomn and this value colomn is like total cost qtt * price .this total cost is showing true in colomn number 1 , but not on colomn number 2, 3 ,4 dst . like on this images. i think i need to loop this total cost on my computed ,

my computed

  computed: { // i need to loop on this but i dont know how 
       
       	totalItems: function() {
	    let total = this.userData[0].qtt * this.userData[0].harga
        this.userData[0].harga_total = total
	    return total
        },

    },

and i have Data like that , and i want to save at harga_total

 data(){
        return{     
            count: 0,
           
            userData:[{
                indukpencairan_id:this.induk,
                nama_barang:'',
                qtt:'',
                satuan:'',
                harga:'',
                harga_total:this.total,// **i want to save at here**
                keterangan:'1933',
                status:'Aktif',
            }],
        }
    },

can someone help this ? better u see this image first and you will know what i mean . sorry for my bad english

Jul
09
2 months ago
Activity icon

Started a new Conversation SUM IN VUE JS

I have input like name , quantity(qtt) ,harga(price) , and total_harga(price x qtt)

I don't have a problem on showing this on table but, I have problem storing this total_harga(sum 1 rows like qtt * price) on my form.

form :

             <div class="field" v-for="data in userData" :key="data.id">
                   <div class="field-body">
                            
                        <div class="field">
                        <label class="label">Nama Barang: </label>
                        <p class="control is-expanded">
                            <input 
                            type="text"
                            name="nama_barang[]"
                            id="nama_barang"
                            class="input"
                            v-model="data.nama_barang"
                            placeholder="nama barang">
                        </p>
                        </div>
                        
                       
                            <div class="field">
                             <label class="label">Quantity:</label>
                            <p class="control is-expanded">
                                <input 
                                type="number"
                                name="qtt[]"
                                id="qtt"
                                class="input"
                                v-model="data.qtt"
                                placeholder="Qtt" >
                            </p>
                            </div>
                            
                            <div class="field">
                            <label class="label">Harga:{{ data.harga | currency}}</label>
                                <p class="control is-expanded">
                                    <input class="input" 
                                    name="harga[]"
                                    type="number"
                                    id="harga"
                                    v-model="data.harga"
                                    placeholder="Harga">
                                </p>
                            </div>

                            <div class="field">
                            <label class="label">Harga Total:</label>
                                <p class="control is-expanded">
                                    <span>{{ (data.harga*data.qtt) | currency}}</span>
                                  
                                </p>
                            </div>       
                    </div>            
                </div>

this harga_total (totalsum 1 rows) is shown correctly. But how can I catch this to send to the db ?

This my vue code :

  data(){
        return{     
            count: 0, 
            userData:[{
                indukpencairan_id:this.induk,
                nama_barang:'',
                qtt:'',
                satuan:'',
                harga:'',
                harga_total:'',
                keterangan:'1933',
                status:'Aktif',
            }],
        }
    },
    components:{
       
    },

    computed: {
        total: function(){

        let total = [];

        Object.entries(this.userData).forEach(([key, val]) => {
            total.push(val.qtt*val.harga) // the value of the current key.
        });

        return total.reduce(function(total, num){ return total + num }, 0);

        },      
    },

   
        
    methods:{
        AddField: function () 
        {
             this.userData.push({ indukpencairan_id:this.induk ,nama_barang: ''  ,qtt: '' ,satuan: '',harga: '' ,harga_total: '',
             keterangan: '1933' ,status: 'Aktif',
            });
        },

        submit() {
            this.errors = {};
            axios.post('/pengadaan/store_pencairan', this.userData).then(response => {
                window.location = response.data.redirect;
            }).catch(error => {
                if (error.response.status === 422) {
                this.errors = error.response.data.errors || {};
                }
            });
        },
       totalItem: function(){ // i try this but still doesnt work
            let sum = 0;
            this.userData.forEach(function(item) {
                sum += (parseFloat(item.harga) * parseFloat(item.qtt));
            });

            return sum;
         }           
    },

someone have solution for this ?

Jul
06
2 months ago
Activity icon

Started a new Conversation Input Form Always Get Empty Value

I have a form using laravel vue js , this form is multiple input and sending array data . but on this store my input has error 500 like this

message: "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'indukpencairan_id' cannot be null (SQL: insert into pencairan (indukpencairan_id, nama_barang, qtt, satuan, harga, harga_total, keterangan, status, updated_at, created_at) values (?, ?, ?, ?, ?, ?, ?, ?, 2020-07-07 03:36:32, 2020-07-07 03:36:32))"

all column in form not send a value . i think i have a mistake but i try to fix this and its didn't get fixed :( , it's my form and vue code

  <h1 class="title is-3  has-text-centered">FORM INPUT</h1>
              <div class="field">
                <button
                class="button is-success"
                type="button" @click="AddField"
                > + Add Colomn
                </button>
             </div>
          
                <div class="field" v-for="data in userData" :key="data.id">
                        <div class="field-body">
                            
                        <div class="field">
                        <label class="label">Nama Barang: </label>
                        <p class="control is-expanded">
                            <input 
                            type="text"
                            name="nama_barang"
                            id="nama_barang"
                            class="input"
                            v-model="data.nama_barang"
                            placeholder="nama barang">
                        </p>
                        </div>
                        
                            <div class="field">
                            <label class="label">Satuan: </label>
                            <p class="control is-expanded">
                                <input 
                                type="text"
                                name="satuan"
                                id="satuan"
                                class="input"
                                v-model="data.satuan"
                                placeholder="Satuan">
                            </p>
                            </div>
                           
                            <div class="field">
                             <label class="label">Quantity:</label>
                            <p class="control is-expanded">
                                <input 
                                type="number"
                                name="qtt"
                                id="qtt"
                                class="input"
                                v-model="data.qtt"
                                placeholder="Qtt" >
                            </p>
                            </div>
                            
                            <div class="field">
                            <label class="label">Harga:{{ data.harga | currency}}</label>
                                <p class="control is-expanded">
                                    <input class="input" 
                                    name="harga"
                                    type="number"
                                    id="harga"
                                    v-model="data.harga"
                                    placeholder="Harga">
                                </p>
                            </div>

                            <div class="field">
                            <label class="label">Harga Total:</label>
                                <p class="control is-expanded">
                                    {{(data.qtt * data.harga) | currency}}
                                </p>
                            </div>

                            
                            
                    </div>
                </div>

and it's my vue

  export default {
    data(){
        return{     
            count: 0,
                
            userData:[{
                indukpencairan_id:1,
                nama_barang:'',
                qtt:'',
                satuan:'',
                harga:'',
                harga_total:'',
                keterangan:'',
                status:'Aktif',
            }],
        }
    },
    
    components:{
       
    },
    props: {
            indukpencairan_id: Number,
        },
    methods:{
        AddField: function () {
             this.userData.push({ indukpencairan_id: '',nama_barang: ''  ,qtt: '' ,satuan: '',harga: '' ,harga_total: '',
             keterangan: '' ,status: 'Aktif',
            });
        },

        submit() {
            this.errors = {};
            axios.post('/pengadaan/store_pencairan', this.userData).then(response => {
                window.location = response.data.redirect;
            }).catch(error => {
                if (error.response.status === 422) {
                this.errors = error.response.data.errors || {};
                }
            });
            },
        
            
    },
   
}

i have a misunderstanding about this userData and data for my store procedure , can someone correct me ?? thankyou

Activity icon

Replied to Input Using Vue Js

so i need add on this data like that ??

 userData:[{
                induk_id:induk_id,
                ................
Jul
05
2 months ago
Activity icon

Started a new Conversation Input Using Vue Js

I am first using input in vue js . this input have structure like this

                induk_id:'',
                nama_barang:'',
                qtt:'',
                satuan:'',
                harga:'',
                harga_total:'',
                keterangan:'',
                status:'Aktif',

this induk_id is foreign key on another table , but i dont know how to pass this induk_id on this vue . i use laravel vue js and this is controller and route

public function input_detail($id)
{
    $pencairan = IndukPencairan::findOrFail($id);
    if (!$pencairan)
    abort(404);
    
    return view('pengadaan.inputdetail',['pencairan' => $pencairan]);
}

this controller on laravel blade i can pass like $pencairan->id for this induk_id , but how i can pass this on vue ?

and its my route

 Route::get('input_detail/{id}', '[email protected]_detail')->name('input_detail');

and its my export default

 export default {
    data(){
        return{     
            count: 0,
            userData:[{
                induk_id:'',
                nama_barang:'',
                qtt:'',
                satuan:'',
                harga:'',
                harga_total:'',
                keterangan:'',
                status:'Aktif',
            }],
        }
    },
    
    components:{
       
    },
    methods:{
        submit() {
            this.errors = {};
            axios.post('/pengadaan/store_induk_pencairan', this.userData).then(response => {
                window.location = response.data.redirect;
            }).catch(error => {
                if (error.response.status === 422) {
                this.errors = error.response.data.errors || {};
                }
            });
            },
         AddField: function () {
             this.userData.push({ induk_id: '',nama_barang: ''  ,qtt: '' ,satuan: '',harga: '' ,harga_total: '',
             keterangan: '' ,status: 'Aktif',
             });
              }
            
    },

my question is how i retrieve induk_id in vue js ?

Activity icon

Started a new Conversation How To Create Data Binding With Array Input ( Multiple Input) On Vue

I have form input using vue js and this input have button to add more colomn input this button . like this picture image . so on this single input i use v-model and its work , but on my new form this v-model and data binding didnt work . you can see my form like this :

on this new from , this v-model didnt work

  <script type="x-template" id="form-input">
         <div class="field">
                        <div class="field-body">
                  
                        <div class="field">
                        <label class="label">Nama Barang: </label>
                        <p class="control is-expanded">
                            <input 
                            type="text"
                            id="nama_barang"
                            class="input"
                           // v-model="userData.nama_barang" ---> if i add this v-model like this this form not showing , if i remove this its work , but i need v-model to store data
                            placeholder="nama barang">
                        </p>
                        </div>
                        
                            <div class="field">
                            <label class="label">Satuan: </label>
                            <p class="control is-expanded">
                                <input 
                                type="text"
                                id="satuan"
                                class="input"
                               // v-model="userData.satuan" ---> if i add this v-model like this this form not showing , if i remove this its work , but i need v-model to store data
                                 placeholder="Satuan">
                            </p>
                            </div>
                           
                            <div class="field">
                             <label class="label">Quantity:</label>
                            <p class="control is-expanded">
                                <input 
                                type="number"
                                id="qtt"
                                class="input"
                                //v-model="userData.qtt" ---> if i add this v-model like this this form not showing , if i remove this its work , but i need v-model to store data
                                placeholder="Qtt" >
                            </p>
                            </div>
                            
                            <div class="field">
                            <label class="label">Harga:</label>
                                <p class="control is-expanded">
                                    <input class="input" 
                                    type="number"
                                    id="harga"
                                    //v-model="userData.harga" ---> if i add this v-model like this this form not showing , if i remove this its work , but i need v-model to store data
                                    placeholder="Harga">
                                </p>
                            </div>

                            <div class="field">
                            <label class="label">Harga Total:</label>
                                <p class="control is-expanded">
                                    {{(userData.qtt * userData.harga) | currency}} // its didnt work because this v-model didnt work
                                </p>
                            </div>
                            
                    </div>
                </div>

and its my export default

 export default {
    data(){
        return{
            fields: [],
            count: 0,
            userData:[{
                rek_id:'',
                tgl_pengajuan:'',
                suplier_id:'',
                status:'Aktif',
            }],
            rek:{},
            suplier:{},
            fields: [],
            count: 0,

        }
    },
    
    components:{
       
    },
    methods:{
        submit() {
            this.errors = {};
            axios.post('/pengadaan/store_induk_pencairan', this.userData).then(response => {
                window.location = response.data.redirect;
            }).catch(error => {
                if (error.response.status === 422) {
                this.errors = error.response.data.errors || {};
                }
            });
            },
        addFormElement: function(type) {
            this.fields.push({
                'type': type,
                id: this.count++
              });
            },
            
    },

so how this v-model on new form can work like one single form ? this v-model only work on only first form

Jun
23
2 months ago
Activity icon

Replied to Laravel Can't Pass ID On Modal Input

some time ago I used boostrap and it went well, this time I tried with capital from bulma and I got this problem

Activity icon

Replied to Laravel Can't Pass ID On Modal Input

i inspect this and this value not showing like this . if this data binding is true its will showing value i think

   <input type="text" name="kode_rekening" id="kode_rekening" value="">
Activity icon

Replied to Laravel Can't Pass ID On Modal Input

no , its not passed . you can see this data-id , and anymore didnt connect with this jquery code , !?

Activity icon

Replied to Laravel Can't Pass ID On Modal Input

this problem on this data-id . its cant passing on this js sir . i use bulma but on this js its js for bootstrap , its the problem ???

Activity icon

Started a new Conversation Laravel Can't Pass ID On Modal Input

So iam using bulma for my modal input and i have problem in my input always get 404 . and this problem is this id cant stored on this form . you can see this form like this and i dont know where my fault

1.Table

  @foreach ($data as $i)
    <tr>
       <td>{{ $i->turunan_anak->uraian}}</td>
       <td>16</td>
       <td>46</td>
       <td>{{$i->kode_rekening}}</td>
       <td>{{$i->uraian}}</td>
       @if(empty($i->user_id))
       <td>belum dipilih</td>
       @else()
       <td>   $i->users->nama_unit</td>
        @endif
       
       <td> 
        <a class = "button is-danger modal-button" id="lanuchModal"
                  data-id="{{$i->id}}"
                  data-user_id="{{$i->user_id}}"
                  data-target="#modal"
                  >Pilih Pelaksana</a> 
       </td> 
       @endforeach

2.Modal

         <form  action="{{route('store_id'),'test'}} " method="post">
                  @csrf
                  {{method_field('patch')}}
                <div id="modal" class="modal">
                  <div class="modal-background"></div>
                  <div class="modal-card">
                    <header class="modal-card-head">
                      <p class="modal-card-title">Pilih Pelaksana</p>
                      <button class="delete" id="modal-close" aria-label="close"></button>
                    </header>
                    <section class="modal-card-body">
                        <div class="field">
                            <div class="control">                      
                          
                              <div class="select is-medium is-danger"> 
                                <select id="user_id" name="user_id">
                                  @foreach($pelaksana as $id => $nama )
                                  <option value="{{ $id }}">{{ $nama }}</option>
                                  @endforeach
                                </select>
                              </div>
                              <input type="hidden" name="id" id="id" value="">
                            </div>
                          </div>
                    </section>
                    <footer class="modal-card-foot">
                      <button type="submit" class="button is-success">Save changes</button>
                    </footer>
                  </div>
                </div>
              </form>
  1. My Js for modal

     <script>
     $('.modal').on('show.bs.modal', function (event) {
    
         var button = $(event.relatedTarget) // Button that triggered the modal
         var id           = button.data('id')
         var user_id      = button.data('user_id')
         var modal = $(this)
    
         modal.find('.modal-card-body #id').val(id);
         modal.find('.modal-card-body #user_id').val(user_id);
     })
      </script>
    
  2. and last its my die dump

array:4 [▼
  "_token" => "KV5anuTdRXWt3RKHtFMzgud6DN69PzXQX0Pj9ire"
  "_method" => "patch"
  "user_id" => "3"
  "id" => null
]

this id always null i dont know what happen , anyone have solution ?

May
18
4 months ago
Activity icon

Replied to Select Multiple Value Getting Error On Where Clause

solved with this

 public function search_filter(Request $request)
  {   
   
	$stats = $request->gejala;
   
    $query = Gejala::query();
   
    $columns = $stats;
    $query->where(function($q) use ($columns, $stats) {
        foreach($columns as $column){
            $q->orWhere($column,'Ya');
        } 
    });
    $gejala = $query->paginate();

    return view('users.data_pasien',['gejala' => $gejala]);
   }
Activity icon

Replied to Select Multiple Value Getting Error On Where Clause

Like this :

id l Batuk l Pilek l Demam l

  1. l. Yes. l. No. l. No. l
  2. l. No. l. Yes. l. Yes. l
  3. l. Yes. l. Yes. l. Yes. l

So in my queries i want to select colomn (not all) buat more than 1 , where value only 'Yes' . Are you know what i mean ?

May
17
4 months ago
Activity icon

Replied to Select Multiple Value Getting Error On Where Clause

Yes i have it . I think your queries is fault . My request is for name colomn , and my value just 'Yes' or ,'No' .

Activity icon

Replied to Select Multiple Value Getting Error On Where Clause

My $stats is my colomn sir

Activity icon

Started a new Conversation Select Multiple Value Getting Error On Where Clause

I have a Input select 2 , and its want multiple value so this data is array . its my input :

      <form action="{{ route('search_filter') }}" method="GET">
                                <div class="select is-multiple is-focused">
                                    <select name="gejala[]" multiple size="5">
                                      <option value='demam'>demam</option>
                                      <option value="riwayat_demam">riwayat_demam</option>
                                      <option value="batuk">batuk</option>
                                      <option value="pilek">pilek</option>
                                     </select>
                                <div>
      </form>

and this die dump on this input is :

array:3 [▼ 0 => "riwayat_demam" 1 => "batuk" 2 => "pilek" ]

sooo on my controller i create a function :

 public function search_filter(Request $request)
{   
    $input = $request->gejala;
   
    $stats = collect($input);

    $gejala = Gejala::where($stats , 'Ya')->paginate();
   
     dd($gejala);

    //return view('users.data_pasien',['gejala' => $gejala]);
}

but after submitting form i have error like this :

Column not found: 1054 Unknown column '["demam","riwayat_demam","batuk","pilek"]' in 'where clause' (SQL: select count(*) as aggregate from gejala where ["demam","riwayat_demam","batuk","pilek"] = Ya)

i use where , if i use whereIn this error like this :

Argument 1 passed to Illuminate\Database\Query\Builder::cleanBindings() must be of the type array, string given, called in

i think i missed on my query where clause multiple colomn in 1 value , can someone corect my code ?

May
03
4 months ago
Activity icon

Replied to Laravel 7 NOT Having Error CORS ?

wait . my problem is , i didnt get error CORS , i not using anything like barryvdh/laravel-cors , but i dont get error CORS , its normall ?

Activity icon

Replied to Laravel 7 NOT Having Error CORS ?

what ? you mean delete package and service.php ?

Activity icon

Started a new Conversation Laravel 7 NOT Having Error CORS ?

I have so many question for this , i am studying about laravel API , and i found CORS error on this tutorial . like this tutorial https://www.itsolutionstuff.com/post/laravel-6-cors-middleware-tutorialexample.html . i trying this , create route , and passing this URL on another HTML code , but i not found this cors like on this tutorial . i am NOT installed this barryvdh/laravel-cors , but this cors is not showing :( . its laravel 7 is automatic support for this ? thank you

Apr
29
4 months ago
Apr
28
4 months ago
Activity icon

Started a new Conversation How Create Middleware On Laravel SPA From Cretueusebiu

iam new and just learning about laravel SPA . i try to create project laravel spa from github : https://github.com/cretueusebiu/laravel-vue-spa .

so next step i want to add middleware , but in the structure i dont know what happens to do .

this folder on

js
  middleware
        admin.js
        auth.js
        check-auth.js
        guest.js
        locale.js

        

on admin.js

import store from '~/store'

export default (to, from, next) => {
  if (store.getters['auth/user'].role !== 'admin') {
    next({ name: 'home' })
  } else {
    next()
  }
}

this role is admin but on table users i didnt see anything about role or anything , please tell me . someone who already uses this , i just wanna ask , how to can create some middleware like , users ,admin ,super admin , or anything . thankyou

Apr
23
4 months ago
Activity icon

Started a new Conversation Bulma Colomn Didnt Work (showing) On Laravel

I used laravel and I download bulma package from bulma site . i extract this file on public folder . this css like navbar , container , its work normally . but after i try to create a colomn , this colomn not showing . i add this src in my head like this :

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="{{ asset('theme/bulma-0.8.2/bulma-0.8.2/css/bulma.css') }}" rel="stylesheet">
<link href="{{ asset('theme/bulma-0.8.2/bulma-0.8.2/css/bulma.min.css') }}" rel="stylesheet">

but i create a colomn like this :

 <div class="columns">
     <div class="column">
        First column
         </div>
     <div class="column">
        Second column
         </div>
     <div class="column">
        Third column
       </div>
     <div class="column">
        Fourth column
     </div>
 </div>

like this picture picture

what wrong about this ?

Apr
01
5 months ago
Activity icon

Started a new Conversation The Best Way To Create Component Laravel Vue SPA

I learn and practice about vue js , and want to create a component like 1 view include Navbar , Footer , etc. I create index for a first view now i want to add navbar . but this navbar cant showed in the index view . this my folder structure:

Resource 
	*js
		*spa
			*IndexComponent
			*HeaderComponent
		*app.js
		*App.vue
		*boostrap.js

on my IndexComponent its my code :

<template>
  <table class="table is-hoverable">
    <thead>
      <tr>
        <th><abbr title="Position">#</abbr></th>
        <th>Unit</th>
        <th><abbr title="Pengajuan">Pengajuan</abbr></th>
        <th><abbr title="Quantity">Qty</abbr></th>
        <th><abbr title="Ukuran">Size</abbr></th>
        <th><abbr title="Status Ajuan">Status Ajuan</abbr></th>
        <th><abbr title="Status Urgensi">Status Urgensi</abbr></th>
        <th>Keterangan</th>
      </tr>
    </thead>
   
    <tbody>
      <tr>
        <th>1</th>
        <td>Bangsal Cempaka</td>
        <td>Tisue Toilet</td>
        <td>12</td>
        <td>Buah</td>
        <td><span class="tag is-warning">Pending</span></td>
        <td><span class="tag is-light" >Non Set</span></td>  
        <td>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellat</td>
      </tr>
      <tr>
        <th>1</th>
        <td>Bangsal Cempaka</td>
        <td>Tisue Toilet</td>
        <td>12</td>
        <td>Buah</td>
        <td><span class="tag is-warning">Pending</span></td>
        <td><span class="tag is-light" >Non Set</span></td>  
        <td>Lorem ipsum dolor sit amet consectetur adipisicing elit. A cupiditate, ?</td>
      </tr>

    </tbody>
  	</table>
 
	</div>
 </section>


</div>
</template>

i use vue router , and using this to access another page . this is view on App.vue

<template>
<router-view></router-view>
</template>

<script>
export default {
}
</script>

in this my app.js and boostrap.js

 require('./bootstrap');

 window.Vue = require('vue');

  import VueRouter from 'vue-router';
  Vue.use(VueRouter);

  import VueAxios from 'vue-axios';
  import axios from 'axios';

  import App from './App.vue';
  Vue.use(VueAxios, axios);


  import IndexComponent from './components/spa/IndexComponent.vue';
  import HeaderComponent from './components/spa/HeaderComponent.vue';
  import FooterComponent from './components/spa/FooterComponent.vue';
  import AboutComponent from './components/spa/AboutComponent.vue';



  const routes = [
      {
          name: 'index',
          path: '/',
          component: IndexComponent
      }, 
      {
          name: 'about',
          path: '/about',
          component: AboutComponent
      },	

   ];

   const router = new VueRouter({
    mode: 'history',
	   routes: routes
   });

   const app = new Vue(Vue.util.extend({ router }, App)).$mount('#app');

so how i can add this navbar to always on view if i change this index ? so this navbar will dinamic on every view

Mar
28
5 months ago
Activity icon

Replied to Progressbar Type And Animated Didnt Work To Change

i see triped effect . now i changed vue strap to boostrap vue but its all is not changed , this animated didnt work . but this color ( type : primary ,danger ,etcc ) its can work . animated didnt work , why ???

Mar
27
5 months ago
Activity icon

Started a new Conversation Progressbar Type And Animated Didnt Work To Change

i Want to make a progress bar using vue strap . i install vue strap on this link

this link

now i add a progress bar, this progress bar is showing , this bar is only showing color primary and cant showing animated .

 <template>
        <div class="progress">
            <progressbar now="99"  type="danger" striped animated ></progressbar>
        </div>
</template>

<script>
    import { progressbar } from 'vue-strap'

    export default {
        components: {
          progressbar
        },
        mounted() {
            console.log('Component mounted.')
        }
    }
</script>

with this code , this type is primary and this animated didnt work . i change browser from chrome to mozila , but its still didnt work . my browser is newest .

whats wrong about this ? i dont know why animated didnt work