โง '๋ฉ๋ฉํ์ ๋ผ๋ผ๋ฒจ๋ก ์๋ก ๋ง๋ค๊ธฐ' ํ๋ก์ ํธ ๋ชฉ์ฐจ โง (๋ณด์๋ ค๋ฉด ์๋ ๋๋ณด๊ธฐ ๋ฅผ ๋๋ฌ์ฃผ์ธ์.)
0. ๋ผ๋ผ๋ฒจ(laravel) ๊ฐ๋ฐ ํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ-๋ฐฉ๋ฒ2 (Windows & ๋์ปค(docker) & sail ํ์ฉ)
2. ๊ธฐ์กด ์์ค๋ฅผ ํ๋์ ๋ธ๋ ์ด๋๋ก
5. ๊ธฐ์กด PHP ๋ก์ง์ ์ปจํธ๋กค๋ฌ๋ก
6. ๋ธ๋ ์ด๋ ๋ฌธ๋ฒ์ผ๋ก ์์
7. ์ธ๋ถ ๋ธ๋ ์ด๋ ํ์ผ, component ํ์ฉ
8. (DB) Model ๋ฐ ๊ธฐํ ํ์ผ ์์ฑ
9. (DB) ๋๋ฏธ๋ฐ์ดํฐ๋ฅผ ํ๊ธ๋ก ๋ง๋๋ ๋ฐฉ๋ฒ
10. (DB) ๋ชจ๋ธ, DB ํ์ฉ ์ฐ์ต
11. (DB) ๊ธฐ์กด ๋ฐ์ดํฐ ๋ฐฐ์ด์ DB๋ก ๋ณํ
12. (DB) DB ๋ฐ ๋ชจ๋ธ์ ์ด์ฉํ์ฌ ๊ตฌํ
13. ๋ก๊ทธ์ธ ๊ตฌํ์ ์ํ ์คํํฐํคํธ Breeze ์ค์น ๋ฐ ๋ก๊ทธ์ธ ์์
14. ๋ก๊ทธ์ธ ์ฐฝ ๋ท๋ฐฐ๊ฒฝ๋ ๋์์์ด ๋ณด์ด๋๋ก ์์
15. ๊ด๋ฆฌ์ ํ๋ฉด์์ ์ ์ฒด ๊ฒ์๊ธ ๋ฆฌ์คํธ ํ๋ฒ์ ๋ณด๊ธฐ
16. ๊ด๋ฆฌ์ ํ๋ฉด์์ ๊ฒ์๊ธ ์์ ํ๊ธฐ
17. ๊ด๋ฆฌ์ ํ๋ฉด์์ ๊ฒ์๊ธ ์ญ์ ํ๊ธฐ
1. AdminPostController ์ปจํธ๋กค๋ฌ ์์ฑ ๋ฐ index() ์์ฑ
class AdminPostController extends Controller
{
public function index()
{
return view('dashboard',[
'posts' => Post::all()
]);
}
}
2. ์ปจํธ๋กค๋ฌ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด web.php ์์
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
//์ ์๋์ ๊ฐ์ด ์์
use App\Http\Controllers\AdminPostController;
Route::get('/dashboard', [AdminPostController::class,'index'])->middleware(['auth', 'verified'])->name('dashboard');
3. dashboard.blade.php ์์
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Dashboard') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
You're logged in!
</div>
</div>
</div>
</div>
</x-app-layout>
์ ์์ค๋ฅผ ์๋์ ๊ฐ์ด ์์ ํฉ๋๋ค.
์ฐธ๊ณ ๋ก ์ดํ ๋์ค๋ ์์ค๋ค์ ๋ผ๋ผ๋ฒจ์ ๊ณต๋ถํ๊ธฐ ์ํด ๋ณด์๋ ์์ ์์ ๋์ค๋ ์์ค๋ฅผ ํ์ฉํ ๊ฒ์ ๋๋ค. ์์ธํ ์ค๋ช ์ ์๋ ์์์ ์ฐธ๊ณ ํ์๊ธฐ ๋ฐ๋๋๋ค.
https://laracasts.com/series/laravel-8-from-scratch
Laravel 8 From Scratch
We don't learn tools for the sake of learning tools. Instead, we learn them because they help us accomplish a particular goal. With that in mind, in this series, we'll use the common desire for a blog - with categories, tags, comments, email notifications,
laracasts.com
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Dashboard') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="flex flex-col">
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8 ">
<div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg ">
<table class="min-w-full divide-y divide-gray-200 ">
<tbody class="bg-white divide-y divide-gray-200 ">
@foreach ($posts as $post)
<tr>
<td class="px-6 py-4 whitespace-nowrap ">
<div class="flex items-center ">
<div class="text-sm font-medium text-gray-900 ">
<a href="/dashboard/{{ $post->id }}/edit">
{{ $post->title }}
</a>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<a href="/dashboard/{{ $post->id }}/edit"
class="text-blue-500 hover:text-blue-600">Edit</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<form method="POST" action="/dashboard/{{ $post->id }}">
@csrf
@method('DELETE')
<button class="text-xs text-gray-400">Delete</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>
๐บ๐บ ์์ ํ ๋ชจ๋ ์์ค๋ ์๋ ๋งํฌ์์ ํ์ธํ์ค ์ ์์ต๋๋ค. ๐บ๐บ
https://github.com/mmssem/munghome
GitHub - mmssem/munghome
Contribute to mmssem/munghome development by creating an account on GitHub.
github.com