diff --git a/.env b/.env
index 497a145..5a17487 100644
--- a/.env
+++ b/.env
@@ -1,4 +1,4 @@
-APP_NAME=Laravel
+APP_NAME=dym
APP_ENV=local
APP_KEY=base64:/4iQMUGojyypXAMaOjvIRIHHG+a/cbY+2KLC2ToQYHQ=
APP_DEBUG=true
@@ -52,7 +52,7 @@ MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
-MAIL_FROM_ADDRESS="hello@example.com"
+MAIL_FROM_ADDRESS="re@dym.sh"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
diff --git a/app/Http/Controllers/RegisteredUserController.php b/app/Http/Controllers/RegisteredUserController.php
index 6fd1b9e..a2bba01 100644
--- a/app/Http/Controllers/RegisteredUserController.php
+++ b/app/Http/Controllers/RegisteredUserController.php
@@ -26,6 +26,6 @@ class RegisteredUserController extends Controller
Auth::login( $user );
- return redirect('/admin');
+ return redirect('/articles');
}
}
diff --git a/app/Http/Controllers/SessionController.php b/app/Http/Controllers/SessionController.php
index 7decb33..34745a1 100644
--- a/app/Http/Controllers/SessionController.php
+++ b/app/Http/Controllers/SessionController.php
@@ -27,7 +27,7 @@ class SessionController extends Controller
request()->session()->regenerate();
- return redirect('/dashboard');
+ return redirect('/articles');
}
public function destroy()
diff --git a/app/Models/Article.php b/app/Models/Article.php
index 2f01c5d..cadd27e 100644
--- a/app/Models/Article.php
+++ b/app/Models/Article.php
@@ -6,32 +6,11 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
-class Article //extends Model
+class Article extends Model
{
- use HasFactory;
+ protected $table = 'articles';
- public static function all(): array {
- return [
- [ 'id' => 1,
- 'title' => 'First One',
- 'slug' => '1st',
- 'body' => 'First!!1
- lol',
- ],
- [ 'id' => 2,
- 'title' => 'Second One',
- 'slug' => '2nd',
- 'body' => 'Second i do concour
- lmfao',
- ],
- [ 'id' => 3,
- 'title' => 'Third One',
- 'slug' => '3rd',
- 'body' => 'Third indeed
- xD',
- ],
- ];
- }
+ use HasFactory;
public static function find(string $slug): array
{
diff --git a/app/View/Components/layout-admin.php b/app/View/Components/layout-dashboard.php
similarity index 80%
rename from app/View/Components/layout-admin.php
rename to app/View/Components/layout-dashboard.php
index 7f1ca3e..c2d8c93 100644
--- a/app/View/Components/layout-admin.php
+++ b/app/View/Components/layout-dashboard.php
@@ -6,7 +6,7 @@ use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
-class layout-admin extends Component
+class layout_dashboard extends Component
{
/**
* Create a new component instance.
@@ -21,6 +21,6 @@ class layout-admin extends Component
*/
public function render(): View|Closure|string
{
- return view('components.layout-admin');
+ return view('components.layout-dashboard');
}
}
diff --git a/database/migrations/2024_08_09_112756_create_articles.php b/database/migrations/2024_08_09_112756_create_articles.php
new file mode 100644
index 0000000..a1df494
--- /dev/null
+++ b/database/migrations/2024_08_09_112756_create_articles.php
@@ -0,0 +1,37 @@
+id();
+ $table->string('slug');
+ $table->string('title');
+ $table->text('body');
+ $table->integer('category');
+ $table->boolean('is_collection');
+ $table->integer('tag_1');
+ $table->integer('tag_2');
+ $table->integer('tag_3');
+ $table->integer('tag_4');
+ $table->integer('tag_5');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('articles');
+ }
+};
diff --git a/public/css/admin.css b/public/css/dashboard.css
similarity index 100%
rename from public/css/admin.css
rename to public/css/dashboard.css
diff --git a/resources/views/dashboard.blade.php b/resources/views/articles.blade.php
similarity index 67%
rename from resources/views/dashboard.blade.php
rename to resources/views/articles.blade.php
index 740b855..d925435 100644
--- a/resources/views/dashboard.blade.php
+++ b/resources/views/articles.blade.php
@@ -1,4 +1,4 @@
-
@foreach($articles as $article)
@@ -6,4 +6,6 @@
@endforeach
-
{{ $message }}
-@enderror -{{ $message }}
+ @enderror +{{ $message }}
+ @enderror +