This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
395 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## v 2.0.0 | ||
|
||
* Completely working version with admin panel | ||
|
||
## v 1.0.0 | ||
|
||
* Initial version [Released 01.02.2023] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\Options; | ||
use Illuminate\Contracts\Foundation\Application; | ||
use Illuminate\Contracts\View\Factory; | ||
use Illuminate\Contracts\View\View; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Request; | ||
|
||
class OptionsController extends Controller | ||
{ | ||
|
||
/** | ||
* Store a new option instance in the database | ||
* | ||
* @param Request $request | ||
* | ||
* @return RedirectResponse | ||
*/ | ||
public function store(Request $request): RedirectResponse | ||
{ | ||
|
||
Options::create( | ||
[ | ||
'name' => $request->name, | ||
'value' => $request->value, | ||
'description' => $request->description, | ||
] | ||
); | ||
|
||
return redirect('admin.options'); | ||
} | ||
|
||
/** | ||
* Show edit form | ||
* | ||
* @param Options $option | ||
* | ||
* @return Application|Factory|View | ||
*/ | ||
public function edit(Options $option): View|Factory|Application | ||
{ | ||
|
||
return view('admin.option_edit', compact('option')); | ||
} | ||
|
||
/** | ||
* Update a Domain instance in the database | ||
* | ||
* @param Request $request | ||
* @param Options $option | ||
* | ||
* @return RedirectResponse | ||
*/ | ||
public function update(Request $request, Options $option): RedirectResponse | ||
{ | ||
|
||
$formFields = $request->validate( | ||
[ | ||
'name' => 'max:255', | ||
'value' => 'required', | ||
'description' => 'max:255', | ||
] | ||
); | ||
|
||
$option->update($formFields); | ||
|
||
return redirect('/pm-admin/options'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Kyslik\ColumnSortable\Sortable; | ||
|
||
class Options extends Model | ||
{ | ||
|
||
use HasFactory; | ||
use Sortable; | ||
|
||
public $sortable = [ | ||
'name', | ||
'value', | ||
'description', | ||
'created_at', | ||
'updated_at', | ||
]; | ||
|
||
protected $fillable = [ | ||
'name', | ||
'value', | ||
'description', | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
return [ | ||
'next' => 'Следващ', | ||
'previous' => 'Предишен', | ||
|
Oops, something went wrong.