Beispiel #1
0
 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(BlockUserRequest $request, Block $block)
 {
     try {
         $this->repository->delete($block->getRouteKey());
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('block::block.name')]), 'code' => 202, 'redirect' => trans_url('/user/block/block')], 202);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
Beispiel #2
0
 public function transform(\Litecms\Block\Models\Block $block)
 {
     return ['id' => $block->getRouteKey(), 'category_id' => ucfirst($block->blockCategories->name), 'name' => ucfirst($block->name), 'url' => $block->url, 'description' => $block->description, 'status' => $block->status, 'image' => $block->image, 'images' => $block->images, 'published' => $block->published == 'Yes' ? 'Published' : '-'];
 }
Beispiel #3
0
 public function transform(\Litecms\Block\Models\Block $block)
 {
     return ['id' => $block->getRouteKey(), 'category_id' => $block->block_categories->name, 'name' => $block->name, 'url' => $block->url, 'description' => $block->description, 'status' => $block->status, 'image' => $block->image, 'images' => $block->images];
 }
Beispiel #4
0
 /**
  * Remove the block.
  *
  * @param Model   $block
  *
  * @return Response
  */
 public function destroy(BlockAdminRequest $request, Block $block)
 {
     try {
         $t = $block->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('block::block.name')]), 'code' => 202, 'redirect' => trans_url('/admin/block/block/0')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/block/block/' . $block->getRouteKey())], 400);
     }
 }