Skip to content

Instantly share code, notes, and snippets.

View JeffreyWay's full-sized avatar

Jeffrey Way JeffreyWay

View GitHub Profile
<div class="bg-gray-200 p-4 rounded block relative">
<h2 class="font-bold">
<a href="https://laracasts.com/discuss/channels/laravel">
Laravel
<span class="absolute inset-0"></span>
</a>
</h2>
<p class="mt-3">
A web application framework with expressive, elegant syntax.
<?php
// Connect to the MySQL database.
$dsn = "mysql:host=localhost;port=3306;dbname=myapp;user=root;charset=utf8mb4";
// Tip: This should be wrapped in a try-catch. We'll learn how, soon.
$pdo = new PDO($dsn);
$statement = $pdo->prepare("select * from posts where id = 1");
$statement->execute();
@JeffreyWay
JeffreyWay / index.php
Last active October 3, 2022 18:34
PHP for Beginners, Episode 10 - Separate Logic From the Template https://laracasts.com/series/php-for-beginners-2023-edition/episodes/10
<?php
$books = [
[
'name' => 'Do Androids Dream of Electric Sheep',
'author' => 'Philip K. Dick',
'releaseYear' => 1968,
'purchaseUrl' => 'http://example.com'
],
[
@JeffreyWay
JeffreyWay / homework-solution.php
Created September 29, 2022 17:36
PHP for Beginners, Episode 9 - Lambdas and Flexibility
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$books = [
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$movies = [
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$books = [
@JeffreyWay
JeffreyWay / homework-solution.php
Last active October 14, 2024 11:19
PHP For Beginners, Episode 6 - Arrays
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$usernames = [
@JeffreyWay
JeffreyWay / homework-solution.php
Last active August 16, 2024 08:02
PHP For Beginners, Episode 5 - Conditionals and Booleans
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?= 'Hello World' ?>
</h1>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?php