-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
5 changed files
with
97 additions
and
8 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
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,49 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Http\Controllers; | ||
|
||
use Cone\Root\Support\Alert; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Redirect; | ||
|
||
class BelongsToManyController extends RelationController | ||
{ | ||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request, Model $model): RedirectResponse | ||
{ | ||
$field = $request->route('field'); | ||
|
||
$field->handleFormRequest($request, $model); | ||
|
||
return Redirect::to('') | ||
->with('alerts.relation-created', Alert::success(__('The relation has been created!'))); | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, Model $model, Model $related): RedirectResponse | ||
{ | ||
$field = $request->route('field'); | ||
|
||
$field->handleFormRequest($request, $model); | ||
|
||
return Redirect::back() | ||
->with('alerts.relation-updated', Alert::success(__('The relation has been updated!'))); | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy(Request $request, Model $model, Model $related): RedirectResponse | ||
{ | ||
// | ||
|
||
return Redirect::to('') | ||
->with('alerts.relation-deleted', Alert::success(__('The relation has been deleted!'))); | ||
} | ||
} |
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