fix DirectionProfile store and update
This commit is contained in:
parent
b3d4231ec8
commit
6ae42fafe8
|
@ -33,7 +33,6 @@ class DirectionProfileController extends Controller
|
||||||
$directionProfile->description = $validated['description'];
|
$directionProfile->description = $validated['description'];
|
||||||
$directionProfile->slug = $validated['slug'];
|
$directionProfile->slug = $validated['slug'];
|
||||||
$directionProfile->position = $validated['position'];
|
$directionProfile->position = $validated['position'];
|
||||||
$directionProfile->direction_id = $validated['direction_id'];
|
|
||||||
$directionProfile->save();
|
$directionProfile->save();
|
||||||
|
|
||||||
return redirect()->route('direction_profiles.index');
|
return redirect()->route('direction_profiles.index');
|
||||||
|
@ -61,7 +60,6 @@ class DirectionProfileController extends Controller
|
||||||
$directionProfile->description = $validated['description'];
|
$directionProfile->description = $validated['description'];
|
||||||
$directionProfile->slug = $validated['slug'];
|
$directionProfile->slug = $validated['slug'];
|
||||||
$directionProfile->position = $validated['position'];
|
$directionProfile->position = $validated['position'];
|
||||||
$directionProfile->direction_id = $validated['direction_id'];
|
|
||||||
$directionProfile->save();
|
$directionProfile->save();
|
||||||
|
|
||||||
return redirect()->route('direction_profiles.index');
|
return redirect()->route('direction_profiles.index');
|
||||||
|
@ -69,6 +67,9 @@ class DirectionProfileController extends Controller
|
||||||
|
|
||||||
public function destroy(DirectionProfile $directionProfile): RedirectResponse
|
public function destroy(DirectionProfile $directionProfile): RedirectResponse
|
||||||
{
|
{
|
||||||
|
if ($directionProfile->direction()->exists()) {
|
||||||
|
return back();
|
||||||
|
}
|
||||||
$directionProfile->delete();
|
$directionProfile->delete();
|
||||||
return redirect()->route('direction_profiles.index');
|
return redirect()->route('direction_profiles.index');
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,6 @@ use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Seed the application's database.
|
|
||||||
*/
|
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
|
|
Loading…
Reference in New Issue