diff --git a/app/Http/Controllers/Dashboard/CVController.php b/app/Http/Controllers/Dashboard/CVController.php index 79fe4f8..c123a68 100644 --- a/app/Http/Controllers/Dashboard/CVController.php +++ b/app/Http/Controllers/Dashboard/CVController.php @@ -49,6 +49,7 @@ class CVController extends Controller 'mission' => ($mission = $request->get('mission')) === [''] ? [] : $mission, 'rodo' => ($rodo =$request->get('rodo')) === '' ? null : $rodo, 'position' => $request->get('position'), + 'notes' => $request->get('notes'), ]); return redirect() ->route('admin.cv.store') @@ -72,6 +73,7 @@ class CVController extends Controller 'mission' => ($mission = $request->get('mission')) === [''] ? [] : $mission, 'rodo' => ($rodo =$request->get('rodo')) === '' ? null : $rodo, 'position' => $request->get('position'), + 'notes' => $request->get('notes'), ]); return redirect() ->back() diff --git a/app/Http/Requests/CVRequest.php b/app/Http/Requests/CVRequest.php index 5e2ab03..a617910 100644 --- a/app/Http/Requests/CVRequest.php +++ b/app/Http/Requests/CVRequest.php @@ -18,6 +18,7 @@ class CVRequest extends FormRequest 'mission' => 'nullable|string', 'rodo' => 'nullable|string', 'position' => 'nullable|string', + 'notes' => 'nullable|string', ]; } } diff --git a/app/Http/Resources/FullCVResource.php b/app/Http/Resources/FullCVResource.php index 53b1791..fad962c 100644 --- a/app/Http/Resources/FullCVResource.php +++ b/app/Http/Resources/FullCVResource.php @@ -21,9 +21,10 @@ class FullCVResource extends JsonResource 'locations' => $this->locations, 'views' => $this->resource->info()->select('id')->get()->count(), 'registeredViews' => $this->views, + 'position' => $this->position, 'mission' => explode(PHP_EOL, $this->mission ?? '', 5), 'rodo' => $this->rodo, - 'position' => $this->position, + 'notes' => $this->notes, 'created' => $this->created_at->format('d-m-Y H:i:s'), 'updated' => $this->updated_at->format('d-m-Y H:i:s'), ]; diff --git a/app/Models/CV.php b/app/Models/CV.php index ff995d3..94c0bd0 100644 --- a/app/Models/CV.php +++ b/app/Models/CV.php @@ -19,6 +19,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; * @property string|null $mission * @property string|null $rodo * @property string|null $position + * @property string|null $notes * @property int $views */ class CV extends Model diff --git a/database/migrations/2023_08_01_212400_add_notes_to_cvs_table.php b/database/migrations/2023_08_01_212400_add_notes_to_cvs_table.php new file mode 100644 index 0000000..6690512 --- /dev/null +++ b/database/migrations/2023_08_01_212400_add_notes_to_cvs_table.php @@ -0,0 +1,24 @@ +text('notes')->nullable(); + }); + } + + public function down(): void + { + Schema::table('cvs', function (Blueprint $table) { + $table->dropColumn('notes'); + }); + } +}; diff --git a/resources/js/Pages/CV/Create.vue b/resources/js/Pages/CV/Create.vue index 6c40137..9df848a 100644 --- a/resources/js/Pages/CV/Create.vue +++ b/resources/js/Pages/CV/Create.vue @@ -32,6 +32,7 @@ const form = useForm({ mission: missionToString, rodo: null, position: null, + notes: null, }); function createCV() { @@ -85,15 +86,23 @@ function createCV() { /> + + -defineProps({ +import { computed } from 'vue'; + +const props = defineProps({ cv: { type: Object, required: true, @@ -11,6 +13,10 @@ defineProps({ }); const CV_URL = import.meta.env.VITE_CV_APP_URL; +const cvNotes = computed(() => { + const notes = props.cv.notes; + return notes ? props.cv.notes.split("\n") : null; +}); @@ -75,6 +81,15 @@ const CV_URL = import.meta.env.VITE_CV_APP_URL; Lokalizacje {{ cv.locations.join(' / ') }} + + Notatki + + {{ noteLine }} + +
{{ cv.locations.join(' / ') }}
{{ noteLine }}