Skip to content

Commit

Permalink
fix: big fixes all controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
jhowbhz committed Aug 18, 2024
1 parent 1b5ee8d commit a48f13d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 145 deletions.
5 changes: 0 additions & 5 deletions app/Http/Controllers/Admin/ContatosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public function index()

}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
Expand Down Expand Up @@ -94,8 +91,6 @@ public function show(string $id)
}
}


//upload
public function upload(Request $request)
{
try {
Expand Down
50 changes: 0 additions & 50 deletions app/Http/Controllers/Admin/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

class DashboardController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$user = Auth::user();
Expand All @@ -39,51 +36,4 @@ public function index()
->with('offline', $offline);
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}
17 changes: 2 additions & 15 deletions app/Http/Controllers/Admin/DisparosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ public function index()
->with('tags', $tags);
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
Expand All @@ -46,8 +43,8 @@ public function store(Request $request)
$disparo->name = $request->name;
$disparo->description = $request->description;
$disparo->tag_id = $request->tag_id;
$disparo->status = $request->status;
$disparo->user_id = Auth::user()->id;
$disparo->status = $request->status;

$disparo->save();

Expand Down Expand Up @@ -81,19 +78,12 @@ public function store(Request $request)
}
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
$disparo = Disparos::find($id);

return response()->json($disparo, 200);
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
try {
Expand All @@ -104,6 +94,7 @@ public function update(Request $request, string $id)
$disparo->name = $request->name;
$disparo->description = $request->description;
$disparo->tag_id = $request->tag_id;
$disparo->user_id = Auth::user()->id;
$disparo->status = $request->status;

$disparo->save();
Expand All @@ -121,15 +112,11 @@ public function update(Request $request, string $id)
}
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
try {

$disparo = Disparos::find($id);

$disparo->delete();

return response()->json([
Expand Down
33 changes: 0 additions & 33 deletions app/Http/Controllers/Admin/HistoricoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,16 @@ public function index()
->with('mensagens', $mensagens);
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
Expand Down
17 changes: 4 additions & 13 deletions app/Http/Controllers/Admin/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Models\Contatos;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;

class TagsController extends Controller
Expand All @@ -22,9 +23,6 @@ public function index()

}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
Expand Down Expand Up @@ -55,6 +53,7 @@ public function store(Request $request)
$tag->name = $request->name;
$tag->description = $request->description;
$tag->color = $request->color;
$tag->user_id = Auth::id();
$tag->status = $request->status;

$tag->save();
Expand All @@ -72,9 +71,6 @@ public function store(Request $request)
}
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
try {
Expand All @@ -91,9 +87,6 @@ public function show(string $id)
}
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
try {
Expand Down Expand Up @@ -124,6 +117,7 @@ public function update(Request $request, string $id)
$tag->name = $request->name;
$tag->description = $request->description;
$tag->color = $request->color;
$tag->user_id = Auth::id();
$tag->status = $request->status;

$tag->save();
Expand All @@ -140,10 +134,7 @@ public function update(Request $request, string $id)
]);
}
}

/**
* Remove the specified resource from storage.
*/

public function destroy(string $id)
{
try {
Expand Down
31 changes: 2 additions & 29 deletions app/Http/Controllers/Admin/TemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Models\Templates;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

class TemplatesController extends Controller
{
Expand All @@ -19,17 +20,6 @@ public function index()
->with('templates', $templates);
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
Expand All @@ -40,7 +30,7 @@ public function store(Request $request)
$template->path = $request->path;
$template->type = $request->type;
$template->text = $request->text;
// $template->user_id = auth()->user()->id;
$template->user_id = Auth::id();
$template->status = $request->status;
$template->save();

Expand All @@ -57,9 +47,6 @@ public function store(Request $request)
}
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
try {
Expand All @@ -75,17 +62,6 @@ public function show(string $id)
}
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
try {
Expand All @@ -112,9 +88,6 @@ public function update(Request $request, string $id)
}
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
try {
Expand Down

0 comments on commit a48f13d

Please sign in to comment.