How to turn on/off MySQL strict mode in localhost (xampp)?

 ->STRICT_TRANS_TABLES is responsible for setting MySQL strict mode.

->To check whether strict mode is enabled or not run the below sql:

SHOW VARIABLES LIKE 'sql_mode';

If one of the value is STRICT_TRANS_TABLES, then strict mode is enabled, else not. In my case it gave

+--------------+------------------------------------------+ 
|Variable_name |Value                                     |
+--------------+------------------------------------------+
|sql_mode      |STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION|
+--------------+------------------------------------------+

Hence strict mode is enabled in my case as one of the value is STRICT_TRANS_TABLES.

->To disable strict mode run the below sql:

set global sql_mode='';

[or any mode except STRICT_TRANS_TABLES. Ex: set global sql_mode='NO_ENGINE_SUBSTITUTION';]

->To again enable strict mode run the below sql:

set global sql_mode='STRICT_TRANS_TABLES';

download image in vuejs

   downloadImage(path) {

                var filename = path.replace("storage/images/","")
               var query = this.getAuthHeaders();
                query["params"] = {};
                query["params"] = {
                    path: path.replace("storage/","/app/public/"),
                    filename: filename
                };
                query["responseType"] = 'blob';
                this.axios
                .get(this.getApiUrlByProcess('media-analysis','get_download'), query)
                .then(response => {
                    const url = window.URL.createObjectURL(new Blob([response.data]));
                    const link = document.createElement('a');
                    link.href = url;
                    link.setAttribute('download', filename);
                    document.body.appendChild(link);
                    link.click();
                })
                .catch(err => {
                    console.error(err);
                });
            },

Laravel Add a new column to existing table after processing request

 If (!Schema::connection("print-imports")->hasColumn('job_outputs_files', $column_name)) {

                Schema::table('print-imports.job_outputs_files', function (Blueprint $table) use ($column_name){
                    $table->string($column_name);
                });

4 ways to writing javascript function

default function declaration

 function sum(a,b){return a+b;}

function expression


const sum =  function sum(a,b){return a+b;}

arrrow function

const sum = (a,b) => {return a+b;}

consiec arrow function

const sum = (a,b) =>a+b;




b-table row clicked- sub table | vuejs

<b-table
show-empty
striped
hover
:items="items"
:fields="fields"
no-local-sorting
responsive
@row-clicked="RowClick"
tbody-tr-class="normal-cursor"
>
<template v-slot:row-details="row">
<b-card id="child-table" style="cursor:context-menu">
<b-table
show-empty
striped
hover
:id="'child_items'+row.item.id"
:items="message_items"
:fields="message_fields"
responsive
tbody-tr-class="normal-cursor"
>

</b-table>
<div class="col-md-8">
<form>
<div class="form-group row">
<label class="col-md-3">
title
<span class="text-danger" style="font-weight:bold;">*</span>
</label>
<div class="col-md-9">
<b-form-textarea
id="textarea"
v-model="update_ticket.reply"
placeholder="reply"
rows="3"
max-rows="6"
></b-form-textarea>
</div>
</div>
<div class="form-group row" style="float:right;">
<div class="offset-xs-3 col-xs-9">
<button
type="button"
class="btn btn-primary text-right ma-10px"
@click="updateMessage"
>Submit</button>
</div>
</div>

</form>
</div>
</b-card>
</template>
</b-table>


RowClick(row_data) {
this.update_ticket.ticket_id=row_data.id;
row_data['show_submit_next_level_button'] = false;
if (row_data.hasOwnProperty.call('_showDetails') && row_data._showDetails) {
this.$set(row_data, '_showDetails', false);
} else {
this.items.forEach(row => {
if (row.id == row_data.id) {
this.message_items = row.message;
this.$set(row, '_showDetails', true);
} else {
this.$set(row, '_showDetails', false);
}
})
}

},


forceRerender: function() {
this.renderComponent = false;
this.$nextTick(() => {
this.renderComponent = true;
});
},


after submit render

this.getActiveTickets();
this.forceRerender();


renderComponent: true,



 

Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...