You can call the explain()
method on queries to know extra information about the query.
1Book::where('name', 'Ruskin Bond')->explain()->dd();
1Illuminate\Support\Collection {#5344 2 all: [ 3 {#15407 4 +"id": 1, 5 +"select_type": "SIMPLE", 6 +"table": "books", 7 +"partitions": null, 8 +"type": "ALL", 9 +"possible_keys": null,10 +"key": null,11 +"key_len": null,12 +"ref": null,13 +"rows": 9,14 +"filtered": 11.11111164093,15 +"Extra": "Using where",16 },17 ],18}
Tip given by @amit_merchant