Skip to content

Commit

Permalink
Merge pull request #106 from DSE-Western-Thessaloniki:parapente/issue94
Browse files Browse the repository at this point in the history
Προσθήκη επιλογής για έλεγχο των τιμών που θα μπορεί να εισάγει ο χρήστης και δυνατότητας προσθήκης αρχείων. Σελιδοποίηση στα αποτελέσματα
  • Loading branch information
parapente authored Aug 1, 2024
2 parents c471d16 + cf92999 commit 3c8f7f7
Show file tree
Hide file tree
Showing 88 changed files with 9,350 additions and 3,071 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
/storage/*.key
/vendor
/.idea
/.vscode
!/.vscode/extensions.json
/.vscode/launch.json
/.vscode/settings.json
/nbproject
/.vagrant
Homestead.json
Expand All @@ -29,3 +29,4 @@ yarn-error.log
/**/.*.sw?
/.kdev4
*.kdev4
_ide_helper*
53 changes: 53 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"recommendations": [
"mikestead.dotenv",
"amiralizadeh9480.laravel-extra-intellisense",
"ryannaddy.laravel-artisan",
"onecentlin.laravel-extension-pack",
"formulahendry.auto-close-tag",
"ibm.output-colorizer",
"alefragnani.bookmarks",
"stkb.rewrap",
"hollowtree.vue-snippets",
"formulahendry.code-runner",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-greek",
"codestream.codestream",
"ikappas.composer",
"pranaygp.vscode-css-peek",
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"eamodio.gitlens",
"nhoizey.gremlins",
"ecmel.vscode-html-css",
"brunnerh.insert-unicode",
"zignd.html-css-class-completion",
"codingyu.laravel-goto-view",
"stef-k.laravel-goto-controller",
"ms-vsliveshare.vsliveshare",
"lostintangent.vsls-whiteboard",
"tyriar.lorem-ipsum",
"christian-kohler.path-intellisense",
"mehedidracula.php-namespace-resolver",
"wongjn.php-sniffer",
"sainoba.px-to-rem",
"humao.rest-client",
"syler.sass-indented",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql",
"tabnine.tabnine-vscode",
"visualstudioexptteam.vscodeintellicode",
"redhat.vscode-yaml",
"m1guelpf.better-pest",
"bmewburn.vscode-intelephense-client",
"RobertOstermann.inline-parameters-extended",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"onecentlin.laravel-blade",
"Cardinal90.multi-cursor-case-preserve",
"georgykurian.laravel-ide-helper",
"open-southeners.laravel-pint",
"xdebug.php-debug",
"vue.volar"
]
}
112 changes: 112 additions & 0 deletions app/Http/Controllers/Admin/AcceptedFiletypeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Http\Requests\StoreAcceptedFiletypeRequest;
use App\Http\Requests\UpdateAcceptedFiletypeRequest;
use App\Models\AcceptedFiletype;

class AcceptedFiletypeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->authorizeResource(AcceptedFiletype::class, 'accepted_filetype');
}

/**
* Display a listing of the resource.
*/
public function index()
{
$accepted_filetypes = AcceptedFiletype::all();

return view('admin.accepted_filetype.index')
->with('accepted_filetypes', $accepted_filetypes);
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('admin.accepted_filetype.create');
}

/**
* Store a newly created resource in storage.
*/
public function store(StoreAcceptedFiletypeRequest $request)
{
// Αφαίρεσε το * από την επέκταση αν έχει κατά λάθος δοθεί
$extension = $request->validated('extension');
$extension = str_replace('*.', '.', $extension);

AcceptedFiletype::create(
array_merge(
$request->validated(),
[
'extension' => $extension,
]
)
);

return redirect(route('admin.accepted_filetype.index'))
->with('success', 'Ο τύπος αρχείων δημιουργήθηκε επιτυχώς');
}

/**
* Display the specified resource.
*/
public function show(AcceptedFiletype $acceptedFiletype)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(AcceptedFiletype $acceptedFiletype)
{
return view('admin.accepted_filetype.edit')
->with('accepted_filetype', $acceptedFiletype);
}

/**
* Update the specified resource in storage.
*/
public function update(UpdateAcceptedFiletypeRequest $request, AcceptedFiletype $acceptedFiletype)
{
// Αφαίρεσε το * από την επέκταση αν έχει κατά λάθος δοθεί
$extension = $request->validated('extension');
$extension = str_replace('*.', '.', $extension);

$acceptedFiletype->update(
array_merge(
$request->validated(),
[
'extension' => $extension,
]
)
);

return redirect(route('admin.accepted_filetype.index'))
->with('success', 'Ο τύπος αρχείων ενημερώθηκε επιτυχώς');
}

/**
* Remove the specified resource from storage.
*/
public function destroy(AcceptedFiletype $acceptedFiletype)
{
$acceptedFiletype->delete();

return redirect(route('admin.accepted_filetype.index'))
->with('success', 'Επιτυχής διαγραφή τύπου αρχείων');
}
}
Loading

0 comments on commit 3c8f7f7

Please sign in to comment.