Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Ajustes na normalização da SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
jeidison committed Nov 26, 2018
1 parent 4b1ec06 commit 0b54437
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/named-query.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

return [
'path-sql' => database_path('queries'),
'path-sql' => database_path('named-query/queries'),
];
6 changes: 4 additions & 2 deletions src/NamedQueryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ private function executeQuery($query, $resultClass = null)
private function normalize($module, $name, array $params, $isBind)
{
$xmlDoc = new DOMDocument();
$settings = config_path('named-query.php');
$xmlDoc->load($settings['path-sql'] . "/" . $module . "/" . $name . '.xml');
$settings = config('named-query');

$path = $settings['path-sql'] . "/" . $module . '.xml';
$xmlDoc->load($path);
$searchNode = $xmlDoc->getElementsByTagName("query");
foreach ($searchNode as $node) {
$queryName = $node->getAttribute('name');
Expand Down
2 changes: 1 addition & 1 deletion src/NamedQueryServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function boot()
{
$this->publishes([
__DIR__ . '/../config/named-query.php' => config_path('named-query.php'),
], 'config');
], 'NamedQuery');

$this->publishes([
__DIR__ . '/../database/queries/named-querys.xml' => database_path('named-query/queries/named-query.xml'),
Expand Down

0 comments on commit 0b54437

Please sign in to comment.