Skip to content

Commit e34398c

Browse files
authored
Merge pull request #29 from leafsphp/fix/mvc-core-issues
Fix/mvc core issues
2 parents 04a57ad + 0c74990 commit e34398c

File tree

7 files changed

+147
-114
lines changed

7 files changed

+147
-114
lines changed

app/views/css/app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/* hello world */
2+
3+
h4 {
4+
color: blanchedalmond !important;
5+
}

app/views/errors/404.html

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Page Not Found</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
7-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
8-
<style>
9-
body {
10-
display: flex !important;
11-
align-items: center !important;
12-
justify-content: center !important;
13-
flex-direction: column !important;
14-
height: 95vh !important;
15-
}
16-
</style>
17-
</head>
18-
19-
<body>
20-
<h2>Error 4<span role="img" aria-label="O">&#x1f635;</span>4</h2>
21-
<p>
22-
We could not find the page you requested, please check and try again or <a href="/">Go Back Home</a>
23-
</p>
24-
</body>
25-
</html>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Page Not Found</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link
7+
href="https://fonts.googleapis.com/icon?family=Material+Icons"
8+
rel="stylesheet"
9+
/>
10+
<link
11+
rel="stylesheet"
12+
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
13+
/>
14+
<style>
15+
body {
16+
display: flex !important;
17+
align-items: center !important;
18+
justify-content: center !important;
19+
flex-direction: column !important;
20+
height: 95vh !important;
21+
}
22+
</style>
23+
</head>
24+
25+
<body>
26+
<h2>Error 4<span role="img" aria-label="O">&#x1f635;</span>4</h2>
27+
<p>
28+
We could not find the page you requested, please check and try again
29+
or <a href="/">Go Back Home</a>
30+
</p>
31+
</body>
32+
</html>

app/views/errors/500.html

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Internal Server Error</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
7-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
8-
<style>
9-
body {
10-
display: flex !important;
11-
align-items: center !important;
12-
justify-content: center !important;
13-
flex-direction: column !important;
14-
height: 95vh !important;
15-
}
16-
</style>
17-
</head>
18-
19-
<body>
20-
<h2>Error 5<span role="img" aria-label="O">&#x1f635;</span><span role="img" aria-label="O">&#x1f635;</span></h2>
21-
<p>
22-
Internal Server Error. Please try again later.
23-
</p>
24-
</body>
25-
</html>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Internal Server Error</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link
7+
href="https://fonts.googleapis.com/icon?family=Material+Icons"
8+
rel="stylesheet"
9+
/>
10+
<link
11+
rel="stylesheet"
12+
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
13+
/>
14+
<style>
15+
body {
16+
display: flex !important;
17+
align-items: center !important;
18+
justify-content: center !important;
19+
flex-direction: column !important;
20+
height: 95vh !important;
21+
}
22+
</style>
23+
</head>
24+
25+
<body>
26+
<h2>
27+
Error 5<span role="img" aria-label="O">&#x1f635;</span
28+
><span role="img" aria-label="O">&#x1f635;</span>
29+
</h2>
30+
<p>Internal Server Error. Please try again later.</p>
31+
</body>
32+
</html>

app/views/index.blade.php

Lines changed: 72 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>{{ getenv('APP_NAME') ?? 'Leaf MVC' }}</title>
7+
<title>{{ _env('APP_NAME', 'My Leaf MVC App') }}</title>
88
<link rel="shortcut icon" href="https://leafphp.dev/logo-circle.png" type="image/x-icon">
99

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

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

1623
<link rel="stylesheet"
1724
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">
@@ -20,65 +27,69 @@
2027
</head>
2128

2229
<body class="flex center-all h-screen">
23-
<div class="container">
24-
<div class="mt-3">
25-
<div class="flex center-start">
26-
<img src="https://www.leafphp.dev/logo-circle.png" alt="">
27-
<h4 style="font-size: 22px;">Welcome to Leaf <span class="green">3</span></h4>
28-
</div>
29-
<div class="flex card mt-3">
30-
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
31-
<ion-icon name="book-outline"></ion-icon>
32-
<div class="ml-1">
33-
<h4>
34-
Leaf MVC Documentation
35-
</h4>
36-
<p class="mt-1">
37-
Leaf MVC comes with a clean and developer-friendly documentation for both beginners and seasoned users.
38-
</p>
39-
<a href="https://mvc.leafphp.dev/" target="_blank" rel="noopener">
40-
Leaf MVC Docs
41-
</a>
42-
</div>
43-
</div>
30+
<div class="container">
31+
<div class="mt-3">
32+
<div class="flex center-start">
33+
<img src="https://www.leafphp.dev/logo-circle.png" alt="">
34+
<h4 style="font-size: 22px;">Welcome to Leaf <span class="green">3</span></h4>
35+
</div>
36+
<div class="flex card mt-3">
37+
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
38+
<ion-icon name="book-outline"></ion-icon>
39+
<div class="ml-1">
40+
<h4>
41+
Leaf MVC Documentation
42+
</h4>
43+
<p class="mt-1">
44+
Leaf MVC comes with a clean and developer-friendly documentation for both beginners and
45+
seasoned users.
46+
</p>
47+
<a href="https://mvc.leafphp.dev/" target="_blank" rel="noopener">
48+
Leaf MVC Docs
49+
</a>
50+
</div>
51+
</div>
52+
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
53+
<ion-icon name="laptop-outline"></ion-icon>
54+
<div class="ml-1">
55+
<h4>
56+
Leaf Documentation
57+
</h4>
58+
<p class="mt-1">
59+
Since Skeleton is basically a boilerplate built with Leaf, we recommend checking out the
60+
leaf docs first.
61+
</p>
62+
<a href="https://leafphp.dev" target="_blank" rel="noopener">
63+
Leaf Docs
64+
</a>
65+
</div>
66+
</div>
67+
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
68+
<ion-icon name="logo-twitter"></ion-icon>
69+
<div class="ml-1">
70+
<h4>Twitter</h4>
71+
<p class="mt-1">
72+
Follow Leaf PHP on Twitter to get latest news about releases, new modules, tutorials
73+
and amazing tips.
74+
</p>
75+
<a href="https://twitter.com/leafphp" target="_blank" rel="noopener">@leafphp</a>
76+
</div>
77+
</div>
4478
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
45-
<ion-icon name="laptop-outline"></ion-icon>
46-
<div class="ml-1">
47-
<h4>
48-
Leaf Documentation
49-
</h4>
50-
<p class="mt-1">
51-
Since Skeleton is basically a boilerplate built with Leaf, we recommend checking out the leaf docs first.
52-
</p>
53-
<a href="https://leafphp.dev" target="_blank" rel="noopener">
54-
Leaf Docs
55-
</a>
56-
</div>
57-
</div>
58-
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
59-
<ion-icon name="logo-twitter"></ion-icon>
60-
<div class="ml-1">
61-
<h4>Twitter</h4>
62-
<p class="mt-1">
63-
Follow Leaf PHP on Twitter to get latest news about releases, new modules, tutorials
64-
and amazing tips.
65-
</p>
66-
<a href="https://twitter.com/leafphp" target="_blank" rel="noopener">@leafphp</a>
67-
</div>
68-
</div>
69-
<div class="flex" style="width: calc(50% - 80px); padding: 30px;">
70-
<ion-icon name="logo-youtube"></ion-icon>
71-
<div class="ml-1">
72-
<h4>YouTube</h4>
73-
<p class="mt-1">
74-
We have a youtube channel where we upload videos on leaf, our modules, frameworks and other projects.
75-
</p>
76-
<a href="https://www.youtube.com/channel/UCllE-GsYy10RkxBUK0HIffw" target="_blank" rel="noopener">Leaf YouTube Channel</a>
77-
</div>
78-
</div>
79-
</div>
80-
</div>
81-
</div>
79+
<ion-icon name="logo-youtube"></ion-icon>
80+
<div class="ml-1">
81+
<h4>YouTube</h4>
82+
<p class="mt-1">
83+
We have a youtube channel where we upload videos on leaf, our modules, frameworks and other
84+
projects.
85+
</p>
86+
<a href="https://www.youtube.com/channel/UCllE-GsYy10RkxBUK0HIffw" target="_blank"
87+
rel="noopener">Leaf YouTube Channel</a>
88+
</div>
89+
</div>
90+
</div>
91+
</div>
92+
</div>
8293
</body>
8394

8495
</html>

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "leafs/mvc",
3+
"version": "3.5.0",
34
"description": "A lightweight PHP MVC framework powered by Leaf",
45
"type": "library",
56
"keywords": [
@@ -59,7 +60,10 @@
5960
"App\\Database\\Seeds\\": "app/database/seeds/",
6061
"App\\Database\\Schema\\": "app/database/schema/",
6162
"App\\Database\\Factories\\": "app/database/factories/"
62-
}
63+
},
64+
"exclude-from-classmap": [
65+
"app/database/migrations"
66+
]
6367
},
6468
"config": {
6569
"optimize-autoloader": true,
@@ -71,7 +75,7 @@
7175
"scripts": {
7276
"post-root-package-install": [
7377
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
74-
"@php -r \"unlink('README.MD'); rename('README2.MD', 'README.MD');\""
78+
"@php -r \"if (file_exists('README2.MD')) {unlink('README.MD'); rename('README2.MD', 'README.MD');}\""
7579
],
7680
"post-create-project-cmd": [
7781
"@php leaf key:generate"

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import leaf from '@leafphp/vite-plugin';
44
export default defineConfig({
55
plugins: [
66
leaf({
7-
input: ['app/views/js/app.js', 'app/views/css/app.css'],
7+
input: ['app/views/css/app.css'],
88
refresh: true,
99
}),
1010
],

0 commit comments

Comments
 (0)