1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace DummyNamespace;
- use Dcat\Admin\Widgets\Form;
- use Symfony\Component\HttpFoundation\Response;
- class DummyClass extends Form
- {
- /**
- * Handle the form request.
- *
- * @param array $input
- *
- * @return Response
- */
- public function handle(array $input)
- {
- // dump($input);
- // return $this->error('Your error message.');
- return $this->success('Processed successfully.', admin_url('/'));
- }
- /**
- * Build a form here.
- */
- public function form()
- {
- $this->text('name')->required();
- $this->email('email')->rules('email');
- }
- /**
- * The data of the form.
- *
- * @return array
- */
- public function default()
- {
- return [
- 'name' => 'John Doe',
- 'email' => 'John.Doe@gmail.com',
- ];
- }
- }
|