generated from ucan-lab/docker-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0797a56
commit f68ad38
Showing
8 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Folder extends Model | ||
{ | ||
// | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Folder; | ||
use Illuminate\Http\Request; | ||
|
||
class TaskController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
$folders = Folder::all(); | ||
|
||
return view('tasks/index', [ | ||
'folders' => $folders, | ||
]); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
backend/database/migrations/2020_07_23_060159_create_folders_table.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreateFoldersTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('folders', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('title', 20); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('folders'); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Seeder; | ||
use Illuminate\Support\Facades\DB; | ||
use Carbon\Carbon; | ||
|
||
class FolderTableSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
$titles = ['プライベート', '仕事', '旅行']; | ||
|
||
foreach ($titles as $title) { | ||
DB::table('folders')->insert([ | ||
'title' => $title, | ||
'created_at' => Carbon::now(), | ||
'updated_at' => Carbon::now() | ||
]); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@import url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"); | ||
@import url("https://cdnjs.cloudflare.com/ajax/libs/bootflat/2.0.4/css/bootflat.min.css"); | ||
|
||
body { | ||
background-color: #f4f7f8; | ||
} | ||
|
||
.navbar { | ||
margin: 2rem 0 2.5rem 0; | ||
} | ||
|
||
.my-navbar { | ||
align-items: center; | ||
background: #333; | ||
display: flex; | ||
height: 6rem; | ||
justify-content: space-between; | ||
padding: 0 2%; | ||
margin-bottom: 3rem; | ||
} | ||
|
||
.my-navbar-brand { | ||
font-size: 18px; | ||
} | ||
|
||
.my-navbar-brand, | ||
.my-navbar-item { | ||
color: #8c8c8c; | ||
} | ||
|
||
.my-navbar-brand:hover, | ||
a.my-navbar-item:hover { | ||
color: #ffffff; | ||
} | ||
|
||
.table td:nth-child(2), | ||
.table td:nth-child(3), | ||
.table td:nth-child(4) { | ||
white-space: nowrap; | ||
width: 1px; | ||
} | ||
|
||
.form-control[disabled], | ||
.form-control[readonly] { | ||
background-color: #fff; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="ja"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>ToDo App</title> | ||
<link rel="stylesheet" href="/css/styles.css"> | ||
</head> | ||
|
||
<body> | ||
<header> | ||
<nav class="my-navbar"> | ||
<a class="my-navbar-brand" href="/">ToDo App</a> | ||
</nav> | ||
</header> | ||
<main> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col col-md-4"> | ||
<nav class="panel panel-default"> | ||
<div class="panel-heading">フォルダ</div> | ||
<div class="panel-body"> | ||
<a href="#" class="btn btn-default btn-block"> | ||
フォルダを追加する | ||
</a> | ||
</div> | ||
<div class="list-group"> | ||
@foreach($folders as $folder) | ||
<a href="{{ route('tasks.index', ['id' => $folder->id]) }}" class="list-group-item"> | ||
{{ $folder->title }} | ||
</a> | ||
@endforeach | ||
</div> | ||
</nav> | ||
</div> | ||
<div class="column col-md-8"> | ||
<!-- ここにタスクが表示される --> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
</body> | ||
|
||
</html> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |