style fixing

This commit is contained in:
Roberto Guagliardo
2025-07-09 02:37:23 +02:00
parent ca5719474c
commit 195f20bb69
23 changed files with 68 additions and 51 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
class ContactController extends Controller
{
@@ -14,8 +13,6 @@ class ContactController extends Controller
'message' => 'required|max:5000',
]);
return response()->json(['status' => 'success']);
}
}

View File

@@ -10,6 +10,7 @@ class EducationController extends Controller
public function index()
{
$educations = Education::with('media')->latest()->get();
return view('educations.index', compact('educations'));
}
@@ -73,6 +74,7 @@ class EducationController extends Controller
public function destroy(Education $education)
{
$education->delete();
return redirect()->route('educations.index')->with('success', 'Opleiding verwijderd.');
}
}

View File

@@ -2,13 +2,13 @@
namespace App\Http\Controllers;
use App\Jobs\NotifyTelegramAboutContactMessage;
use App\Jobs\NotifyTelegramAboutPersonaliaClick;
use App\Models\Education;
use App\Models\Personalia;
use App\Models\Skill;
use App\Models\WorkExperience;
use Illuminate\Http\Request;
use App\Jobs\NotifyTelegramAboutPersonaliaClick;
use App\Jobs\NotifyTelegramAboutContactMessage;
class FrontendController extends Controller
{
@@ -38,7 +38,7 @@ class FrontendController extends Controller
}
public function message(Request $request)
{
{
$validated = $request->validate([
'name' => 'required|string|max:255',
'message' => 'required|string|max:5000',
@@ -56,6 +56,5 @@ class FrontendController extends Controller
);
return response()->json(['status' => 'success']);
}
}
}

View File

@@ -10,6 +10,7 @@ class PersonaliaController extends Controller
public function index()
{
$personalia = Personalia::all();
return view('personalia.index', compact('personalia'));
}
@@ -41,7 +42,6 @@ class PersonaliaController extends Controller
return view('personalia.edit', ['personalia' => $personalium]);
}
public function update(Request $request, Personalia $personalium)
{
$validated = $request->validate([

View File

@@ -13,6 +13,7 @@ class SkillController extends Controller
public function index()
{
$skills = Skill::latest()->get();
return view('skills.index', compact('skills'));
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers;
use App\Models\WorkExperience;
@@ -9,6 +10,7 @@ class WorkExperienceController extends Controller
public function index()
{
$experiences = WorkExperience::with('media')->latest()->get();
return view('work_experiences.index', compact('experiences'));
}
@@ -58,8 +60,6 @@ class WorkExperienceController extends Controller
'afbeelding' => 'nullable|image|max:2048',
]);
$workExperience->update($data);
if ($request->hasFile('afbeelding')) {
@@ -73,6 +73,7 @@ class WorkExperienceController extends Controller
public function destroy(WorkExperience $workExperience)
{
$workExperience->delete();
return redirect()->route('work-experiences.index')->with('success', 'Ervaring verwijderd.');
}
}

View File

@@ -14,10 +14,15 @@ class NotifyTelegramAboutContactMessage implements ShouldQueue
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected string $name;
protected string $message;
protected string $ip;
protected string $userAgent;
protected string $email;
protected string $phone;
public function __construct(string $name, string $message, string $ip, string $userAgent, ?string $email = null, ?string $phone = null)
@@ -30,7 +35,6 @@ class NotifyTelegramAboutContactMessage implements ShouldQueue
$this->phone = $phone;
}
public function handle()
{
$email = $this->email ?? '';
@@ -51,7 +55,7 @@ class NotifyTelegramAboutContactMessage implements ShouldQueue
🕒 Tijdstip: *{now()->format('d-m-Y H:i')}*
TEXT;
Http::post("https://api.telegram.org/bot" . config('services.telegram.bot_token') . "/sendMessage", [
Http::post('https://api.telegram.org/bot'.config('services.telegram.bot_token').'/sendMessage', [
'chat_id' => config('services.telegram.chat_id'),
'text' => $text,
'parse_mode' => 'Markdown',

View File

@@ -15,7 +15,9 @@ class NotifyTelegramAboutPersonaliaClick implements ShouldQueue
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $personalia;
protected $ip;
protected $userAgent;
public function __construct(Personalia $personalia, $ip, $userAgent)
@@ -37,7 +39,7 @@ User Agent: `{$this->userAgent}`
📅 Tijdstip: *{$this->personalia->updated_at->format('d-m-Y H:i')}*
TEXT;
Http::post("https://api.telegram.org/bot" . config('services.telegram.bot_token') . "/sendMessage", [
Http::post('https://api.telegram.org/bot'.config('services.telegram.bot_token').'/sendMessage', [
'chat_id' => config('services.telegram.chat_id'),
'text' => $message,
'parse_mode' => 'Markdown',

View File

@@ -5,10 +5,13 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
class Education extends Model implements HasMedia
{
use InteractsWithMedia;
protected $table = 'education';
protected $fillable = [
'opleiding',
'instituut',
@@ -21,6 +24,7 @@ class Education extends Model implements HasMedia
{
return $this->getFirstMedia('image');
}
public function imageUrl()
{
return $this->image() ? $this->image()->getUrl() : null;

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
@@ -6,7 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class Personalia extends Model
{
protected $fillable = ['key', 'value', 'hidden', 'icon'];
protected $table = 'personalia';
protected $casts = [
'hidden' => 'boolean',
];
@@ -15,6 +18,7 @@ class Personalia extends Model
{
return $this->getFirstMedia('image');
}
public function imageUrl()
{
return $this->image() ? $this->image()->getUrl() : null;

View File

@@ -3,7 +3,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
@@ -17,6 +16,7 @@ class Skill extends Model implements HasMedia
{
return $this->getFirstMedia('image');
}
public function imageUrl()
{
return $this->image() ? $this->image()->getUrl() : null;

View File

@@ -22,6 +22,7 @@ class WorkExperience extends Model implements HasMedia
{
return $this->getFirstMedia('image');
}
public function imageUrl()
{
return $this->image() ? $this->image()->getUrl() : null;

View File

@@ -9,7 +9,8 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up(): void {
public function up(): void
{
Schema::create('work_experiences', function (Blueprint $table) {
$table->id();
$table->string('werkgever');

View File

@@ -20,7 +20,6 @@ return new class extends Migration
});
}
/**
* Reverse the migrations.
*/

View File

@@ -1,13 +1,13 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void {
public function up(): void
{
Schema::create('education', function (Blueprint $table) {
$table->id();
$table->string('opleiding'); // vergelijkbaar met 'werkgever'
@@ -19,7 +19,8 @@ return new class extends Migration
});
}
public function down(): void {
public function down(): void
{
Schema::dropIfExists('education');
}
};

View File

@@ -22,5 +22,4 @@ return new class extends Migration
$table->dropColumn('type');
});
}
};

View File

@@ -6,6 +6,7 @@ use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class DatabaseSeeder extends Seeder
{
/**
@@ -24,7 +25,6 @@ class DatabaseSeeder extends Seeder
]
);
// Andere seeders uitvoeren
$this->call([
EducationSeeder::class,

View File

@@ -12,7 +12,7 @@ class EducationSeeder extends Seeder
{
$path = database_path('data/education.json');
if (!File::exists($path)) {
if (! File::exists($path)) {
return;
}

View File

@@ -12,8 +12,9 @@ class MediaSeeder extends Seeder
{
$path = database_path('data/media.json');
if (!File::exists($path)) {
$this->command->warn("media.json niet gevonden, seeding overgeslagen.");
if (! File::exists($path)) {
$this->command->warn('media.json niet gevonden, seeding overgeslagen.');
return;
}

View File

@@ -2,8 +2,8 @@
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\Personalia;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
class PersonaliaSeeder extends Seeder
@@ -12,8 +12,9 @@ class PersonaliaSeeder extends Seeder
{
$path = database_path('data/personalia.json');
if (!File::exists($path)) {
if (! File::exists($path)) {
$this->command->warn("Bestand {$path} bestaat niet, seeder overgeslagen.");
return;
}
@@ -33,6 +34,6 @@ class PersonaliaSeeder extends Seeder
]);
}
$this->command->info(count($data) . ' personalia-records geïmporteerd.');
$this->command->info(count($data).' personalia-records geïmporteerd.');
}
}

View File

@@ -2,8 +2,8 @@
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\Skill;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
class SkillSeeder extends Seeder
@@ -12,7 +12,7 @@ class SkillSeeder extends Seeder
{
$path = database_path('data/skills.json');
if (!File::exists($path)) {
if (! File::exists($path)) {
return;
}

View File

@@ -2,8 +2,8 @@
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\WorkExperience;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
class WorkExperienceSeeder extends Seeder
@@ -13,8 +13,9 @@ class WorkExperienceSeeder extends Seeder
$jsonPath = database_path('data/work_experiences.json');
// Bestaat het JSON-bestand?
if (!File::exists($jsonPath)) {
if (! File::exists($jsonPath)) {
$this->command->warn("❌ Bestand $jsonPath niet gevonden. Seeder overgeslagen.");
return;
}
@@ -40,6 +41,6 @@ class WorkExperienceSeeder extends Seeder
);
}
$this->command->info("✅ Werkervaringen succesvol geïmporteerd.");
$this->command->info('✅ Werkervaringen succesvol geïmporteerd.');
}
}

View File

@@ -7,7 +7,6 @@ use App\Http\Controllers\Auth\EmailVerificationPromptController;
use App\Http\Controllers\Auth\NewPasswordController;
use App\Http\Controllers\Auth\PasswordController;
use App\Http\Controllers\Auth\PasswordResetLinkController;
use App\Http\Controllers\Auth\RegisteredUserController;
use App\Http\Controllers\Auth\VerifyEmailController;
use Illuminate\Support\Facades\Route;