Commit eb207d98 authored by Nicolas Widart's avatar Nicolas Widart

Making the module name required

parent 99b203d2
......@@ -28,8 +28,7 @@ class WorkbenchController extends AdminBaseController
public function migrate(MigrateModuleRequest $request)
{
$output = new BufferedOutput;
$arguments = $request->name ? ['module' => $request->name] : [];
Artisan::call('module:migrate', $arguments, $output);
Artisan::call('module:migrate', ['module' => $request->module], $output);
Flash::message($output->fetch());
return Redirect::route('dashboard.workbench.index');
......
......@@ -6,7 +6,9 @@ class GenerateModuleRequest extends FormRequest
{
public function rules()
{
return [];
return [
'name' => 'required'
];
}
public function authorize()
......
......@@ -6,7 +6,9 @@ class MigrateModuleRequest extends FormRequest
{
public function rules()
{
return [];
return [
'module' => 'required'
];
}
public function authorize()
......
......@@ -23,9 +23,10 @@
@include('flash::message')
{!! Form::open(['route' => 'dashboard.workbench.generate.index', 'method' => 'post']) !!}
<div class="box-body">
<div class='form-group'>
<div class='form-group{{ $errors->has('name') ? ' has-error' : '' }}'>
{!! Form::label('name', 'Module Name:') !!}
{!! Form::text('name', Input::old('name'), ['class' => 'form-control', 'placeholder' => 'Module Name']) !!}
{!! $errors->first('name', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="box-footer">
......@@ -37,9 +38,10 @@
@include('flash::message')
{!! Form::open(['route' => 'dashboard.workbench.migrate.index', 'method' => 'post']) !!}
<div class="box-body">
<div class='form-group'>
{!! Form::label('name', 'Module Name:') !!}
{!! Form::text('name', Input::old('name'), ['class' => 'form-control', 'placeholder' => 'Module Name']) !!}
<div class='form-group{{ $errors->has('module') ? ' has-error' : '' }}'>
{!! Form::label('module', 'Module Name:') !!}
{!! Form::text('module', Input::old('name'), ['class' => 'form-control', 'placeholder' => 'Module Name']) !!}
{!! $errors->first('module', '<span class="help-block">:message</span>') !!}
</div>
</div>
<div class="box-footer">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment