Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
F
ffs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
beardedwarrior
ffs
Commits
c926ad45
Commit
c926ad45
authored
Dec 30, 2018
by
beardedwarrior
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the process proposals to pull the latest information from the front matter
parent
a042be90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
app/Console/Commands/ProcessProposals.php
app/Console/Commands/ProcessProposals.php
+17
-6
No files found.
app/Console/Commands/ProcessProposals.php
View file @
c926ad45
...
...
@@ -2,6 +2,7 @@
namespace
App\Console\Commands
;
use
App\Project
;
use
Illuminate\Console\Command
;
use
Illuminate\Support\Facades\Storage
;
...
...
@@ -36,20 +37,30 @@ class ProcessProposals extends Command
*/
public
function
handle
()
{
$amounts
=
[];
$projects
=
Project
::
whereNull
(
'filename'
);
$details
=
[];
$files
=
Storage
::
files
(
'ffs-proposals'
);
foreach
(
$files
as
$file
)
{
if
(
strpos
(
$file
,
'.md'
))
{
$amount
[
'name'
]
=
$file
;
$amount
[
'values'
]
=
$this
->
getAmountFromText
(
$file
);
$amounts
[]
=
$amount
;
$detail
[
'name'
]
=
$file
;
$detail
[
'values'
]
=
$this
->
getAmountFromText
(
$file
);
$details
[]
=
$detail
[
'values'
][
'title'
];
$project
=
$projects
->
where
(
'title'
,
$detail
[
'values'
][
'title'
])
->
first
();
if
(
$project
)
{
$project
->
filename
=
$file
;
$project
->
target_amount
=
$detail
[
'values'
][
'amount'
];
$project
->
save
();
}
}
}
dd
(
$amounts
);
foreach
(
$details
as
$det
)
{
$this
->
line
(
$det
);
}
}
/**
* Gets the ffs
amount requested from a
file
* Gets the ffs
variables out the top of the
file
*
* @param string $filename
* @return array
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment