Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <h1>Create Task</h1>
- <form action="/insert">
- Title:<br>
- <input type="text" name="Title">
- <br>
- Completed:<br>
- <input type="text" name="Completed">
- <br>
- Description:<br>
- <input type="text" name="Description">
- <br><br>
- <input type="submit" value="Submit">
- </form>
- </body>
- </html>
- Route::get('/', function () {
- return view('task');
- });
- Route::get('/create_task', function () {
- return view('create_task');
- });
- Route::get('/decide', "Task_Controller@decide");
- Route::get('/insert', "Task_Controller@insert");
- <?php
- namespace AppHttpControllers;
- use DB;
- use DateTime;
- use IlluminateHttpRequest;
- use IlluminateSupportFacadesInput;
- class Task_Controller extends Controller
- {
- public function insert()
- {
- $Title = Input::get('Title');
- $Completed = Input::get('Completed');
- $Description = Input::get('Description');
- $insert=DB::table('task')->insert(['Title' => $Title,'Completed' => $Completed,'Description'=> $Description,'created_at' => new DateTime ,'updated_at'=>new DateTime]);
- if($insert)
- echo"Successfully inserted";
- else
- echo "error";
- }
- }
- APP_ENV=local
- APP_KEY=base64:dpAJ8RO+F4IaiahWWlSUDI9v4nju442zeFEBHmh42XM=
- APP_DEBUG=true
- APP_LOG_LEVEL=debug
- APP_URL=http://localhost
- BROADCAST_DRIVER=log
- CACHE_DRIVER=file
- SESSION_DRIVER=file
- QUEUE_DRIVER=sync
- REDIS_HOST=127.0.0.1
- REDIS_PASSWORD=null
- REDIS_PORT=6379
- MAIL_DRIVER=smtp
- MAIL_HOST=smtp.mailtrap.io
- MAIL_PORT=2525
- MAIL_USERNAME=null
- MAIL_PASSWORD=null
- MAIL_ENCRYPTION=null
- PUSHER_APP_ID=
- PUSHER_APP_KEY=
- PUSHER_APP_SECRET=
Add Comment
Please, Sign In to add comment