Skip to content

Commit f721287

Browse files
committed
slug added in job,resume and resume section type added
1 parent e181d7b commit f721287

30 files changed

+13003
-5
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
},
99
"require": {
1010
"fakerphp/faker": "^1.23",
11-
"ramsey/uuid": "^4.7"
11+
"ramsey/uuid": "^4.7",
12+
"cocur/slugify": "^4.5"
1213
},
1314
"autoload": {
1415
"psr-4": {

composer.lock

Lines changed: 75 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/Factories/Job/DummyJobGenerate.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Cbx\Careertoolkit\Factories\Job;
44

5+
use Cocur\Slugify\Slugify;
56
use Cbx\Careertoolkit\Factories\Factory;
67
use Faker\Factory as FakerFactory;
78

@@ -78,6 +79,13 @@ public function run( $args, $assoc_args ) {
7879
$cbxjob['closing_date'] = date( 'Y-m-d H:i:s', strtotime( '+7 days' ) );
7980
$cbxjob['expiry_date'] = date( 'Y-m-d H:i:s', strtotime( '+7 days' ) );
8081

82+
$slugify = new Slugify();
83+
84+
$existing_slugs = \Cbx\Job\Models\CBXJob::query()->pluck( 'slug' )->toArray();
85+
$temp_slug = $slugify->slugify( $cbxjob['title'] );
86+
$slug = \Cbx\Job\Helpers\CBXJobHelpers::generate_unique_slug( $temp_slug, $existing_slugs );
87+
88+
$cbxjob['slug'] = $slug;
8189

8290
\Cbx\Job\Models\CBXJob::query()->create( $cbxjob );
8391
}

includes/Factories/Resume/DummyResumeGenerate.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Cbx\Careertoolkit\Factories\Resume;
44

5+
use Ramsey\Uuid\Uuid;
56
use Cbx\Careertoolkit\Factories\Factory;
67
use Faker\Factory as FakerFactory;
78

@@ -64,6 +65,12 @@ public function run( $args, $assoc_args ) {
6465
'add_date' => date( 'Y-m-d H:i:s' )
6566
];
6667

68+
69+
$slug = Uuid::uuid4();;
70+
71+
$formData['slug'] = $slug;
72+
$formData['uuid'] = $slug;
73+
6774
\Cbx\Resume\Models\Resume::query()->create( $formData );
6875
}
6976

@@ -85,6 +92,7 @@ public function run( $args, $assoc_args ) {
8592
private function aboutMe() {
8693
return [
8794
"key" => "aboutme",
95+
"type" => "aboutme",
8896
"value" => [
8997
(object) [
9098
"new" => true,
@@ -113,7 +121,8 @@ private function aboutMe() {
113121
*/
114122
private function avatar() {
115123
return [
116-
"key" => "",
124+
"key" => "avatar",
125+
"type" => "avatar",
117126
"value" => [
118127
(object) [
119128
"pic" => "",
@@ -133,6 +142,7 @@ private function avatar() {
133142
private function education() {
134143
return [
135144
"key" => "education",
145+
"type" => "education",
136146
"value" => [
137147
(object) [
138148
"organization" => FakerFactory::create()->company(),
@@ -177,6 +187,7 @@ private function education() {
177187
private function experience() {
178188
return [
179189
"key" => "experience",
190+
"type" => "experience",
180191
"value" => [
181192
(object) [
182193
"title" => FakerFactory::create()->jobTitle(),
@@ -215,6 +226,7 @@ private function experience() {
215226
private function skills() {
216227
return [
217228
"key" => "skill",
229+
"type" => "skill",
218230
"value" => [
219231
(object) [
220232
"name" => FakerFactory::create()->name(),
@@ -253,6 +265,7 @@ private function skills() {
253265
private function course() {
254266
return [
255267
"key" => "course",
268+
"type" => "course",
256269
"value" => [
257270
(object) [
258271
"name" => FakerFactory::create()->name(),
@@ -287,6 +300,7 @@ private function course() {
287300
private function license() {
288301
return [
289302
"key" => "license",
303+
"type" => "license",
290304
"value" => [
291305
(object) [
292306
"name" => FakerFactory::create()->name(),
@@ -317,6 +331,7 @@ private function license() {
317331
private function language() {
318332
return [
319333
"key" => "language",
334+
"type" => "language",
320335
"value" => [
321336
(object) [
322337
"name" => "Bangla",
@@ -339,6 +354,7 @@ private function language() {
339354
private function website() {
340355
return [
341356
"key" => "website",
357+
"type" => "website",
342358
"value" => [
343359
(object) [
344360
"category" => "PERSONAL",
@@ -373,6 +389,7 @@ private function website() {
373389
private function project() {
374390
return [
375391
"key" => "project",
392+
"type" => "project",
376393
"value" => [
377394
(object) [
378395
"title" => FakerFactory::create()->name(),
@@ -439,6 +456,7 @@ private function project() {
439456
private function honor() {
440457
return [
441458
"key" => "honor",
459+
"type" => "honor",
442460
"value" => [
443461
(object) [
444462
'title' => FakerFactory::create()->title(),
@@ -467,6 +485,7 @@ private function honor() {
467485
private function publication() {
468486
return [
469487
"key" => "publication",
488+
"type" => "publication",
470489
"value" => [
471490
(object) [
472491
"name" => FakerFactory::create()->name(),
@@ -489,6 +508,7 @@ private function publication() {
489508
private function patent() {
490509
return [
491510
"key" => "patent",
511+
"type" => "patent",
492512
"value" => [
493513
(object) [
494514
"title" => "Electric Light Bulb",
@@ -514,6 +534,7 @@ private function patent() {
514534
private function hobby() {
515535
return [
516536
"key" => "hobby",
537+
"type" => "hobby",
517538
"value" => [
518539
(object) [
519540
"name" => FakerFactory::create()->name()
@@ -540,6 +561,7 @@ private function hobby() {
540561
private function volunteer() {
541562
return [
542563
"key" => "volunteer",
564+
"type" => "volunteer",
543565
"value" => [
544566
(object) [
545567
"companyName" => FakerFactory::create()->company(),

lib/cocur/slugify/LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2012-2017 Florian Eckerstorfer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)