This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function up() | |
{ | |
Schema::create('test', function (Blueprint $table) { | |
$table->id(); | |
$table->timestamps(); | |
}); | |
} | |
public function down() | |
{ | |
Schema::dropIfExists('test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function up() | |
{ | |
Schema::create('todo', function (Blueprint $table) { | |
$table->id(); | |
$table->timestamps(); | |
$table->string('name'); //I added the name column | |
$table->text('description'); //I added the description column | |
}); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title> | |
@yield('title') | |
</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('title') | |
My Todo App | |
@endsection | |
@section('content') | |
<div class="row mt-3"> | |
<div class="col-12 align-self-center"> | |
<ul class="list-group"> | |
<li class="list-group-item"><a href="details">Dummy todo here</a></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('title') | |
Create Todo | |
@endsection | |
@section('content') | |
<form action="" method="post" class="mt-4 p-4"> | |
<div class="form-group m-3"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('title') | |
Details | |
@endsection | |
@section('content') | |
<div class="card text-center mt-5"> | |
<div class="card-header"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('title') | |
Edit Todo | |
@endsection | |
@section('content') | |
<form action="" method="post" class="mt-4 p-4"> | |
<div class="form-group m-3"> | |
<label for="name">Todo Name</label> | |
<input type="text" class="form-control" name="" value="Name here"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('title') | |
My Todo App | |
@endsection | |
@section('content') | |
<div class="row mt-3"> | |
<div class="col-12 align-self-center"> | |
<ul class="list-group"> | |
@foreach($todos as $todo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="store-data" method="post" class="mt-4 p-4"> | |
@csrf | |
<div class="form-group m-3"> | |
<label for="name">Todo Name</label> | |
<input type="text" class="form-control" name=""> | |
</div> | |
<div class="form-group m-3"> | |
<label for="description">Todo Description</label> | |
<textarea class="form-control" name="description" rows="3"></textarea> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function store(){ | |
try { | |
$this->validate(request(), [ | |
'name' => ['required'], | |
'description' => ['required'] | |
]); | |
} catch (ValidationException $e) { | |
} |
OlderNewer