Closed mertasan closed 3 years ago
If you don't want to execute your queries, I suggest using ->dump()
and pass that to ray()
ray(DB::table('users')->where('id', 1)->dump());
Thanks @Nielsvanpach
public function build()
{
$this->joins();
if($this->search){
$this->searchQueries();
}
if($this->filter){
$this->filterQueries();
}
$this->selectFields();
}
In a project that starts as above and consists of dozens of queries, should I do all the queries this way?
How will the proceedings proceed?
If what I want isn't possible, it's ok. But that should not be the path I should follow.
public function getRowsProperty()
{
return $this->query->paginate($this->getTablePerPage());
}
Note: I created random code samples. It's not a real build.
I'm not sure what your question is.
All SQL queries added after the ray()->showQueries() function should be displayed in the Ray application.
This only happens if an actual query is executed. If you only want to build queries without executing them, I suggest to dump your query and pass them to Ray manually.
Describe the bug
While developing a project, I need to constantly check the db queries with ray.
But Ray expects me to get the data to print the SQL queries.
In other words, I can't see the generated queries without completing most of the project.
Versions
PHP version: 8.0.7 Laravel version: 8.5.20
To Reproduce Steps to reproduce the behavior:
https://[domain].test/make-query
(no results) - Source codehttps://[domain].test/get-first
(its working) - Source codehttps://[domain].test/where
(no results) - Source codeExpected behavior
All SQL queries added after the
ray()->showQueries()
function should be displayed in the Ray application.Desktop (please complete the following information):