$operation = Operation::with([
'tasks' => function ($query) {
$query->select('id');
},
])->whereIn('name', ["whitelistedUri.view", 'user.view'])->get();
{
"id": 201,
"name": "user.view",
"sso_id": 6,
"tasks": [
{
"id": 2,
"pivot": {
"operation_id": 201,
"task_id": 2
}
}
]
},
{
"id": 306,
"name": "whitelistedUri.view",
"sso_id": 7,
"tasks": [
{
"id": 1,
"pivot": {
"operation_id": 306,
"task_id": 1
}
},
{
"id": 2,
"pivot": {
"operation_id": 306,
"task_id": 2
}
}
]
}
docker run --rm --name migrator migrator -v /src/database/migrations:/src/database /bin/sh -c "migrator -c 'php artisan migrate'"
public function getAll($searchPattern)
{
$key = 'key';
$files = glob($searchPattern);
foreach (glob(dirname($searchPattern) . '/*', GLOB_ONLYDIR) as $dir) {
$files = array_merge($files, [$key=>$this->getAll($dir . '/' . basename($searchPattern))]);
}
return $files;
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"key": {
"key": [
"\/generate\/test.json",
"\/document\/generate\/test2json",
"\/document\/generate\/test3.json"
]
}
}
}
Array
(
[0] => /path/test/generate/test.json
[1] => /path/test/generate/test2.json
)
Array
(
' path.test.generate.test'=> /path/test/generate/test.json
'path.test.generate.test2' => /path/test/generate/test2.json
)