Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .env.example

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ yarn-error.log
/.zed

.DS_store
/*/**/.DS_store
/*/**/.DS_store
.env.example
.env.example
.env.example
.env.example
89 changes: 48 additions & 41 deletions app/Livewire/Pages/Jobs/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Livewire\Pages\Jobs;

use App\Models\JobListing;
use Livewire\Component;

class Index extends Component
Expand All @@ -10,50 +11,56 @@ class Index extends Component

public function mount()
{
$this->jobs = [
[
"id" => 1,
"title" => "Sr. Full Stack Developer",
"description" => "You will be responsible for designing, developing, and maintaining robust and scalable web applications from end to end. You must have a deep understanding of both frontend and backend development, thrives in a collaborative environment, and is passionate about delivering high-quality software solutions",
"company_name" => "DWebPixel",
"company_logo" => asset('logo-3.svg'),
"experience" => "4-5 Yrs",
"salary" => "$ 4.5-8 Lacs PA",
"location" => "Remote",
"skills" => [
"Laravel",
"React",
"Vue",
"MySQL",
],
"extra" => [
"Remote",
"Full-Time",
]
],
[
"id" => 2,
"title" => "Sr. Frontend Developer",
"description" => "You will leverage your expertise in modern frontend technologies and best practices to create exceptional user experiences.",
"company_name" => "DWebPixel",
"company_logo" => asset('logo-2.svg'),
"experience" => "3-4 Yrs",
"salary" => "$ 2.5-4 Lacs PA",
"location" => "Remote",
"skills" => [
"React",
"Vue",
],
"extra" => [
"Remote",
"Full-Time",
]
]
];
// $this->jobs = [
// [
// "id" => 1,
// "title" => "Sr. Full Stack Developer",
// "description" => "You will be responsible for designing, developing, and maintaining robust and scalable web applications from end to end. You must have a deep understanding of both frontend and backend development, thrives in a collaborative environment, and is passionate about delivering high-quality software solutions",
// "company_name" => "DWebPixel",
// "company_logo" => asset('logo-3.svg'),
// "experience" => "4-5 Yrs",
// "salary" => "$ 4.5-8 Lacs PA",
// "location" => "Remote",
// "skills" => [
// "Laravel",
// "React",
// "Vue",
// "MySQL",
// ],
// "extra" => [
// "Remote",
// "Full-Time",
// ]
// ],
// [
// "id" => 2,
// "title" => "Sr. Frontend Developer",
// "description" => "You will leverage your expertise in modern frontend technologies and best practices to create exceptional user experiences.",
// "company_name" => "DWebPixel",
// "company_logo" => asset('logo-2.svg'),
// "experience" => "3-4 Yrs",
// "salary" => "$ 2.5-4 Lacs PA",
// "location" => "Remote",
// "skills" => [
// "React",
// "Vue",
// ],
// "extra" => [
// "Remote",
// "Full-Time",
// ]
// ]
// ];
$this->jobs = JobListing::all()->toArray();
}

public function deleteJob($id)
{
JobListing::findOrFail($id)->delete();
}

public function render()
{
return view('livewire.pages.jobs.index');
}
}
}
70 changes: 70 additions & 0 deletions app/Livewire/Pages/Jobs/JobForm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php

namespace App\Livewire\Pages\Jobs;

use App\Models\JobListing;
use App\Models\Skill;
use Livewire\Component;
use Livewire\WithFileUploads;


class JobForm extends Component
{
use WithFileUploads;

public $title, $company_name, $location, $experience, $salary_range, $description, $company_logo;

public $tags = [], $technologies = [];

public function mount()
{
$this->tags = is_string($this->tags) ? explode(',', $this->tags) : (array) $this->tags;
$this->technologies = Skill::all();
}


protected $rules = [
'title' => 'required|string|max:255',
'company_name' => 'required|string|max:255',
'location' => 'required|string|max:255',
'experience' => 'required|string',
'salary_range' => 'nullable|string',
'tags' => 'nullable|string',
'description' => 'required|string',
'technologies' => 'nullable|array',
'company_logo' => 'required|image|max:2048', // 2MB max
];

public function save()
{
$this->validate();

// Handle file upload if exists
$logoPath = $this->company_logo ? $this->company_logo->store('logos', 'public') : null;

$tagsJson = json_encode($this->tags);
$techJson = json_encode($this->technologies);

JobListing::create([
'title' => $this->title,
'company_name' => $this->company_name,
'location' => $this->location,
'experience' => $this->experience,
'salary_range' => $this->salary_range,
'tags' => $tagsJson,
'description' => $this->description,
'technologies' => $techJson,
'company_logo' => $logoPath,
]);



session()->flash('success', 'Job posting created successfully!');
$this->reset();
}

public function render()
{
return view('livewire.pages.jobs.job-form');
}
}
52 changes: 51 additions & 1 deletion app/Livewire/Pages/Skills/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,62 @@

namespace App\Livewire\Pages\Skills;

use App\Models\Skill;
use Livewire\Component;

class Index extends Component
{

public array $skills = [];
public $name, $skill_id;
public $isEditing = false;

protected $rules = [
'name' => 'required|min:3',
];

public function mount()
{
$this->skills = Skill::all()->toArray();
}

public function saveSkill()
{
$this->validate();

Skill::create(['name' => $this->name]);

$this->reset('name');
session()->flash('message', 'Skill added successfully.');
}

public function editSkill($id)
{
$skill = Skill::findOrFail($id);
$this->skill_id = $skill->id;
$this->name = $skill->name;
$this->isEditing = true;
}

public function updateSkill()
{
$this->validate();

Skill::where('id', $this->skill_id)->update(['name' => $this->name]);

$this->reset(['name', 'skill_id', 'isEditing']);
session()->flash('message', 'Skill updated successfully.');
}

public function deleteSkill($id)
{
Skill::findOrFail($id)->delete();
session()->flash('message', 'Skill deleted successfully.');
}

public function render()
{
return view('livewire.pages.skills.index');

}
}
}
13 changes: 13 additions & 0 deletions app/Models/JobListing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class JobListing extends Model
{
use HasFactory;

protected $fillable = ['title', 'company_name', 'location', 'experience', 'salary_range', 'tags', 'description', 'technologies', 'company_logo'];
}
13 changes: 13 additions & 0 deletions app/Models/Skill.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Skill extends Model
{
use HasFactory;

protected $fillable = ['name'];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('job_listings', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('company_name');
$table->string('company_logo');
$table->string('location')->nullable(); // Example: Remote, On-site
$table->string('experience'); // Example: "3-4 Yrs"
$table->string('salary_range'); // Example: "2.5-4 Lacs PA"
$table->json('tags')->nullable(); // Example: ["Remote", "Full-Time"]
$table->text('description');
$table->json('technologies');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('job_listings');
}
};
Loading