Skip to content

Commit

Permalink
type delete, destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Advaith3600 committed Apr 4, 2022
1 parent 697f112 commit 1bfd243
Show file tree
Hide file tree
Showing 23 changed files with 192 additions and 49 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "A seamless django like admin panel setup for Laravel",
"type": "library",
"require": {
"php": "^8.0.2"
"php": "^8.0.2",
"laravel/framework": "^8.0|^9.0"
},
"license": "MIT",
"autoload": {
Expand Down
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"version": "1.0.0",
"description": "A seamless django like admin panel setup for Laravel",
"scripts": {
"build-tailwind": "npx tailwindcss -i ./src/resources/assets/tailwind/tailwind.css -o ./src/resources/assets/css/tailwind.css --minify",
"build-css": "node-sass ./src/resources/assets/scss/app.scss ./src/resources/assets/css/app.css --output-style compressed",
"build": "npm run build-css && npm run build-tailwindcss",
"watch-tailwind": "npm run build-tailwind -- --watch",
"watch-sass": "npm run build-css -- -w"
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"keywords": [
"laravel",
Expand All @@ -16,8 +18,11 @@
"author": "Advaith A J",
"license": "MIT",
"devDependencies": {
"node-sass": "^7.0.1",
"normalize.css": "^8.0.1",
"tailwindcss": "^3.0.23"
"autoprefixer": "^10.4.4",
"laravel-mix": "^6.0.43",
"postcss": "^8.4.12",
"tailwindcss": "^3.0.23",
"vue": "^3.2.31",
"vue-loader": "^16.2.0"
}
}
6 changes: 6 additions & 0 deletions resources/assets/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/
/******/
/******/ })()
;
27 changes: 27 additions & 0 deletions src/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,31 @@ public function update($type, $id, Request $request)
return $exception->getMessage();
}
}

public function delete($type, Request $request)
{
$ids = $request->ids;

if (count($ids) === 0) abort(404);

return view('seamless::type.delete', [
'type' => $this->resolveType($type),
'ids' => $ids
]);
}

public function destroy($type, Request $request)
{
$type = $this->resolveType($type);
$ids = $request->ids;

if (count($ids) === 0) abort(404);

try {
$type::whereIn('id', $ids)->delete();
return redirect()->route('admin.type.index', request()->type);
} catch (Exception $exception) {
return $exception->getMessage();
}
}
}
2 changes: 1 addition & 1 deletion src/resources/assets/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/resources/assets/css/tailwind.css

This file was deleted.

Loading

0 comments on commit 1bfd243

Please sign in to comment.