This file contains hidden or 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
Route::get('/admin', [AdminController::class, 'index'])->middleware('auth'); |
This file contains hidden or 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
return redirect()->route('dashboard'); |
This file contains hidden or 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
Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard'); |
This file contains hidden or 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
Route::get('/user/{name?}', function ($name = 'Guest') { | |
return "Nama Pengguna: " . $name; | |
}); |
This file contains hidden or 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
Route::get('/user/{id}', function ($id) { | |
return "User ID: " . $id; | |
}); |
This file contains hidden or 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
use App\Http\Controllers\HomeController; | |
Route::get('/home', [HomeController::class, 'index']); |
This file contains hidden or 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
Route::get('/hello', function () { | |
return 'Halo, Laravel!'; | |
}); |
This file contains hidden or 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
<?php | |
$buah = "durian"; | |
switch ($buah) { | |
case "apel": | |
echo "Buah yang dipilih adalah apel, rasanya manis dan segar!"; | |
break; | |
case "pisang": | |
echo "Buah yang dipilih adalah pisang, cocok buat sarapan."; | |
break; |
This file contains hidden or 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
<?php | |
$buah = "apel"; | |
switch ($buah) { | |
case "apel": | |
echo "Buah yang dipilih adalah apel, rasanya manis dan segar!"; | |
break; | |
case "pisang": | |
echo "Buah yang dipilih adalah pisang, cocok buat sarapan."; | |
break; |
This file contains hidden or 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
<?php | |
$cuaca = "cerah"; | |
if($cuaca == "mendung"){ | |
echo "Diam dirumah"; | |
}elseif($cuaca == "cerah"){ | |
echo "pergi main bola"; | |
}else{ | |
echo "mancing aja"; | |
} | |
?> |