File size: 7,889 Bytes
f461a44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lesson Detail - LearnFlow</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <link href="https://cdn.jsdelivr.net/npm/@tailwindcss/custom-forms@0.2.1/dist/custom-forms.min.css" rel="stylesheet">
    <style>
        .video-container {
            position: relative;
            padding-bottom: 56.25%;
            height: 0;
            overflow: hidden;
        }
        .video-container iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body class="bg-gray-50 font-sans antialiased">
    <div class="max-w-4xl mx-auto py-8 px-4">
        <!-- Lesson Header -->
        <div class="mb-8">
            <div class="flex items-center justify-between mb-4">
                <h1 class="text-3xl font-bold text-gray-900">Laravel Routing Basics</h1>
                <div class="flex items-center space-x-2">
                    <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-indigo-100 text-indigo-800">
                        <i data-feather="clock" class="w-4 h-4 mr-1"></i>
                        15 min
                    </span>
                </div>
            </div>
            <p class="text-gray-600">Learn how to define and manage routes in Laravel applications.</p>
        </div>

        <!-- Video Section -->
        <div class="mb-8 bg-white rounded-xl shadow-sm overflow-hidden" x-data="{ hasVideo: true }">
            <div x-show="hasVideo">
                <div class="video-container bg-black">
                    <iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>
                </div>
                <div class="p-4 border-t border-gray-200">
                    <div class="flex justify-between items-center">
                        <span class="text-sm text-gray-500">Video Lesson</span>
                        <button @click="hasVideo = false" class="text-gray-400 hover:text-gray-600">
                            <i data-feather="x" class="w-5 h-5"></i>
                        </button>
                    </div>
                </div>
            </div>
            <div x-show="!hasVideo" class="p-12 text-center bg-gray-100">
                <div class="mx-auto max-w-md">
                    <i data-feather="video-off" class="w-12 h-12 mx-auto text-gray-400 mb-4"></i>
                    <h3 class="text-lg font-medium text-gray-900 mb-2">Video Hidden</h3>
                    <p class="text-gray-600 mb-4">This lesson contains a video that is currently hidden.</p>
                    <button @click="hasVideo = true" class="px-4 py-2 bg-indigo-600 rounded-lg text-white font-medium hover:bg-indigo-700">
                        Show Video
                    </button>
                </div>
            </div>
        </div>

        <!-- Lesson Content -->
        <div class="bg-white rounded-xl shadow-sm overflow-hidden mb-8">
            <div class="p-6">
                <div class="prose max-w-none">
                    <h2>Introduction to Routing</h2>
                    <p>Routing is one of the fundamental concepts in Laravel. It's how your application responds to client requests to specific URIs.</p>
                    
                    <h3>Basic Routing</h3>
                    <p>The most basic Laravel routes accept a URI and a closure:</p>
                    <pre class="bg-gray-100 p-4 rounded-lg overflow-x-auto"><code>Route::get('/', function () {
    return 'Hello World';
});</code></pre>
                    
                    <h3>Route Parameters</h3>
                    <p>Sometimes you will need to capture segments of the URI within your route. You may do so by defining route parameters:</p>
                    <pre class="bg-gray-100 p-4 rounded-lg overflow-x-auto"><code>Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});</code></pre>
                    
                    <h3>Named Routes</h3>
                    <p>Named routes allow convenient generation of URLs or redirects for specific routes:</p>
                    <pre class="bg-gray-100 p-4 rounded-lg overflow-x-auto"><code>Route::get('user/profile', function () {
    // Your logic here
})->name('profile');</code></pre>
                </div>
            </div>
        </div>

        <!-- Attachments -->
        <div class="bg-white rounded-xl shadow-sm overflow-hidden">
            <div class="px-6 py-4 border-b border-gray-200">
                <h3 class="text-lg font-medium text-gray-900 flex items-center">
                    <i data-feather="paperclip" class="w-5 h-5 mr-2"></i>
                    Lesson Attachments
                </h3>
            </div>
            <div class="divide-y divide-gray-200">
                <div class="p-4 hover:bg-gray-50">
                    <div class="flex items-center">
                        <div class="flex-shrink-0">
                            <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center">
                                <i data-feather="file-text" class="w-5 h-5 text-indigo-600"></i>
                            </div>
                        </div>
                        <div class="ml-4 flex-1">
                            <h4 class="text-sm font-medium text-gray-900">Routing Cheat Sheet.pdf</h4>
                            <p class="text-sm text-gray-500">124 KB • PDF</p>
                        </div>
                        <a href="#" class="ml-4 px-3 py-1 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50">
                            Download
                        </a>
                    </div>
                </div>
                <div class="p-4 hover:bg-gray-50">
                    <div class="flex items-center">
                        <div class="flex-shrink-0">
                            <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center">
                                <i data-feather="code" class="w-5 h-5 text-blue-600"></i>
                            </div>
                        </div>
                        <div class="ml-4 flex-1">
                            <h4 class="text-sm font-medium text-gray-900">Example Routes.zip</h4>
                            <p class="text-sm text-gray-500">2.1 MB • ZIP Archive</p>
                        </div>
                        <a href="#" class="ml-4 px-3 py-1 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50">
                            Download
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <!-- Navigation -->
        <div class="mt-8 flex justify-between">
            <a href="#" class="px-6 py-3 bg-white border border-gray-300 rounded-lg text-gray-700 font-medium hover:bg-gray-50">
                <div class="flex items-center space-x-2">
                    <i data-feather="arrow-left" class="w-5 h-5"></i>
                    <span>Previous Lesson</span>
                </div>
            </a>
            <a href="#" class="px-6 py-3 bg-indigo-600 rounded-lg text-white font-medium hover:bg-indigo-700">
                <div class="flex items-center space-x-2">
                    <span>Next Lesson</span>
                    <i data-feather="arrow-right" class="w-5 h-5"></i>
                </div>
            </a>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            feather.replace();
        });
    </script>
</body>
</html>