add components button
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\OwnerTransaction;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class OwnerTransactionController extends Controller
|
||||
{
|
||||
public function create()
|
||||
{
|
||||
return view('owners.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$formFields = $request->validate([
|
||||
'rz_username' => 'required',
|
||||
'timestamp_owner_since' => 'required'
|
||||
]);
|
||||
|
||||
OwnerTransaction::create($formFields);
|
||||
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
public function edit(OwnerTransaction $owner)
|
||||
{
|
||||
return view('owners.edit', ['owner' => $owner]);
|
||||
}
|
||||
|
||||
public function update(OwnerTransaction $owner, Request $request)
|
||||
{
|
||||
$formFields = $request->validate([
|
||||
'rz_username' => 'required',
|
||||
'timestamp_owner_since' => 'required'
|
||||
]);
|
||||
|
||||
$owner->update($formFields);
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function destroy(OwnerTransaction $owner)
|
||||
{
|
||||
$owner->delete();
|
||||
return back();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user