Skip to content

Commit

Permalink
Merge pull request #29 from leafsphp/fix/mvc-core-issues
Browse files Browse the repository at this point in the history
Fix/mvc core issues
  • Loading branch information
mychidarko authored Sep 17, 2024
2 parents 04a57ad + 0c74990 commit e34398c
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 114 deletions.
4 changes: 4 additions & 0 deletions app/views/css/app.css
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* hello world */

h4 {
color: blanchedalmond !important;
}
57 changes: 32 additions & 25 deletions app/views/errors/404.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<style>
body {
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex-direction: column !important;
height: 95vh !important;
}
</style>
</head>

<body>
<h2>Error 4<span role="img" aria-label="O">&#x1f635;</span>4</h2>
<p>
We could not find the page you requested, please check and try again or <a href="/">Go Back Home</a>
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Page Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
/>
<style>
body {
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex-direction: column !important;
height: 95vh !important;
}
</style>
</head>

<body>
<h2>Error 4<span role="img" aria-label="O">&#x1f635;</span>4</h2>
<p>
We could not find the page you requested, please check and try again
or <a href="/">Go Back Home</a>
</p>
</body>
</html>
57 changes: 32 additions & 25 deletions app/views/errors/500.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>Internal Server Error</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<style>
body {
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex-direction: column !important;
height: 95vh !important;
}
</style>
</head>

<body>
<h2>Error 5<span role="img" aria-label="O">&#x1f635;</span><span role="img" aria-label="O">&#x1f635;</span></h2>
<p>
Internal Server Error. Please try again later.
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Internal Server Error</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
/>
<style>
body {
display: flex !important;
align-items: center !important;
justify-content: center !important;
flex-direction: column !important;
height: 95vh !important;
}
</style>
</head>

<body>
<h2>
Error 5<span role="img" aria-label="O">&#x1f635;</span
><span role="img" aria-label="O">&#x1f635;</span>
</h2>
<p>Internal Server Error. Please try again later.</p>
</body>
</html>
133 changes: 72 additions & 61 deletions app/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ getenv('APP_NAME') ?? 'Leaf MVC' }}</title>
<title>{{ _env('APP_NAME', 'My Leaf MVC App') }}</title>
<link rel="shortcut icon" href="https://leafphp.dev/logo-circle.png" type="image/x-icon">

{{-- assets() points to the public/assets folder --}}
<link rel="stylesheet" href="{{ assets('css/styles.css') }}">

{{-- ViewsPath() points to app/views --}}
<link rel="stylesheet" href="{{ ViewsPath('css/app.css') }}">
{{--
You generally want to keep all your css and js in the public folder
unless you are using a bundler like vite. vite() looks for assets in
the app/views folder by default. You can uncomment the line below to
use vite.
Be sure to run `npm install` and then `npm run dev` or `npm run build` first.
--}}
{{-- {{ vite('css/app.css') }} --}}

<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700;display=swap">
Expand All @@ -20,65 +27,69 @@
</head>

<body class="flex center-all h-screen">
<div class="container">
<div class="mt-3">
<div class="flex center-start">
<img src="https://www.leafphp.dev/logo-circle.png" alt="">
<h4 style="font-size: 22px;">Welcome to Leaf <span class="green">3</span></h4>
</div>
<div class="flex card mt-3">
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="book-outline"></ion-icon>
<div class="ml-1">
<h4>
Leaf MVC Documentation
</h4>
<p class="mt-1">
Leaf MVC comes with a clean and developer-friendly documentation for both beginners and seasoned users.
</p>
<a href="https://mvc.leafphp.dev/" target="_blank" rel="noopener">
Leaf MVC Docs
</a>
</div>
</div>
<div class="container">
<div class="mt-3">
<div class="flex center-start">
<img src="https://www.leafphp.dev/logo-circle.png" alt="">
<h4 style="font-size: 22px;">Welcome to Leaf <span class="green">3</span></h4>
</div>
<div class="flex card mt-3">
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="book-outline"></ion-icon>
<div class="ml-1">
<h4>
Leaf MVC Documentation
</h4>
<p class="mt-1">
Leaf MVC comes with a clean and developer-friendly documentation for both beginners and
seasoned users.
</p>
<a href="https://mvc.leafphp.dev/" target="_blank" rel="noopener">
Leaf MVC Docs
</a>
</div>
</div>
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="laptop-outline"></ion-icon>
<div class="ml-1">
<h4>
Leaf Documentation
</h4>
<p class="mt-1">
Since Skeleton is basically a boilerplate built with Leaf, we recommend checking out the
leaf docs first.
</p>
<a href="https://leafphp.dev" target="_blank" rel="noopener">
Leaf Docs
</a>
</div>
</div>
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="logo-twitter"></ion-icon>
<div class="ml-1">
<h4>Twitter</h4>
<p class="mt-1">
Follow Leaf PHP on Twitter to get latest news about releases, new modules, tutorials
and amazing tips.
</p>
<a href="https://twitter.com/leafphp" target="_blank" rel="noopener">@leafphp</a>
</div>
</div>
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="laptop-outline"></ion-icon>
<div class="ml-1">
<h4>
Leaf Documentation
</h4>
<p class="mt-1">
Since Skeleton is basically a boilerplate built with Leaf, we recommend checking out the leaf docs first.
</p>
<a href="https://leafphp.dev" target="_blank" rel="noopener">
Leaf Docs
</a>
</div>
</div>
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="logo-twitter"></ion-icon>
<div class="ml-1">
<h4>Twitter</h4>
<p class="mt-1">
Follow Leaf PHP on Twitter to get latest news about releases, new modules, tutorials
and amazing tips.
</p>
<a href="https://twitter.com/leafphp" target="_blank" rel="noopener">@leafphp</a>
</div>
</div>
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
<ion-icon name="logo-youtube"></ion-icon>
<div class="ml-1">
<h4>YouTube</h4>
<p class="mt-1">
We have a youtube channel where we upload videos on leaf, our modules, frameworks and other projects.
</p>
<a href="https://www.youtube.com/channel/UCllE-GsYy10RkxBUK0HIffw" target="_blank" rel="noopener">Leaf YouTube Channel</a>
</div>
</div>
</div>
</div>
</div>
<ion-icon name="logo-youtube"></ion-icon>
<div class="ml-1">
<h4>YouTube</h4>
<p class="mt-1">
We have a youtube channel where we upload videos on leaf, our modules, frameworks and other
projects.
</p>
<a href="https://www.youtube.com/channel/UCllE-GsYy10RkxBUK0HIffw" target="_blank"
rel="noopener">Leaf YouTube Channel</a>
</div>
</div>
</div>
</div>
</div>
</body>

</html>
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "leafs/mvc",
"version": "3.5.0",
"description": "A lightweight PHP MVC framework powered by Leaf",
"type": "library",
"keywords": [
Expand Down Expand Up @@ -59,7 +60,10 @@
"App\\Database\\Seeds\\": "app/database/seeds/",
"App\\Database\\Schema\\": "app/database/schema/",
"App\\Database\\Factories\\": "app/database/factories/"
}
},
"exclude-from-classmap": [
"app/database/migrations"
]
},
"config": {
"optimize-autoloader": true,
Expand All @@ -71,7 +75,7 @@
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"@php -r \"unlink('README.MD'); rename('README2.MD', 'README.MD');\""
"@php -r \"if (file_exists('README2.MD')) {unlink('README.MD'); rename('README2.MD', 'README.MD');}\""
],
"post-create-project-cmd": [
"@php leaf key:generate"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import leaf from '@leafphp/vite-plugin';
export default defineConfig({
plugins: [
leaf({
input: ['app/views/js/app.js', 'app/views/css/app.css'],
input: ['app/views/css/app.css'],
refresh: true,
}),
],
Expand Down

0 comments on commit e34398c

Please sign in to comment.