File manager - Edit - /home/bookdonate/htdocs/bookdonate.in/public/app.tar
Back
Http/Middleware/RedirectAdminAuthenticated.php 0000777 00000001201 15227040311 0015462 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Symfony\Component\HttpFoundation\Response; use Illuminate\Support\Facades\Auth; use App\Providers\RouteServiceProvider; class RedirectAdminAuthenticated { /** * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next): Response { if (Auth::guard('admin')->check()) { return redirect(RouteServiceProvider::ADMIN_DASHBOARD); } return $next($request); } } Http/Middleware/AdminAuthMiddleware.php 0000777 00000001251 15227040311 0014122 0 ustar 00 <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Symfony\Component\HttpFoundation\Response; use Illuminate\Support\Facades\Auth; class AdminAuthMiddleware { /** * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next): Response { // dd(auth()->guard('admin')->user()) if (Auth::guard('admin')->user()) { Auth::shouldUse('admin'); return $next($request); } else { return redirect(route('admin.login')); } } } Http/Requests/Admin/Blog/StoreBlogRequest.php 0000777 00000002111 15227040311 0015170 0 ustar 00 <?php namespace App\Http\Requests\Admin\Blog; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class StoreBlogRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('create-blog', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ 'title' => ['required', 'min:3', Rule::unique('blogs')], 'image' => ['required'], 'blog_category' => ['required'], 'slug' => ['required', 'min:3', Rule::unique('blogs')], 'status' => ['required'], ]; } } Http/Requests/Admin/Blog/ListBlogRequest.php 0000777 00000001112 15227040311 0015007 0 ustar 00 <?php namespace App\Http\Requests\Admin\Blog; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Foundation\Http\FormRequest; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class ListBlogRequest extends FormRequest { public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('list-blog', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } public function rules(): array { return []; } } Http/Requests/Admin/Blog/UpdateBlogRequest.php 0000777 00000002265 15227040311 0015330 0 ustar 00 <?php namespace App\Http\Requests\Admin\Blog; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class UpdateBlogRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('edit-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { $id = $this->route('blog'); return [ 'title' => ['required', 'min:3', Rule::unique('blogs')->ignore($id)->whereNull('deleted_at')], 'slug' => [ 'required', 'min:3', Rule::unique('blogs')->ignore($id)->whereNull('deleted_at'), ], 'blog_category' => ['required'], ]; } } Http/Requests/Admin/Blog/CreateBlogRequest.php 0000777 00000001470 15227040311 0015306 0 ustar 00 <?php namespace App\Http\Requests\Admin\Blog; use Illuminate\Foundation\Http\FormRequest; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class CreateBlogRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('create-blog', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/Role/ShowRoleRequest.php 0000777 00000001305 15227040311 0015054 0 ustar 00 <?php namespace App\Http\Requests\Admin\Role; use Illuminate\Foundation\Http\FormRequest; class ShowRoleRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { $user = auth()->guard('admin')->user(); if ($user && $user->hasPermissionTo('view-roles', 'admin')) { return true; } return true; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/Role/ListRoleRequest.php 0000777 00000001306 15227040311 0015050 0 ustar 00 <?php namespace App\Http\Requests\Admin\Role; use Illuminate\Foundation\Http\FormRequest; class ListRoleRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { $user = auth()->guard('admin')->user(); if ($user && $user->hasPermissionTo('view-roles', 'admin')) { return true; } return false; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/Role/StoreRoleRequest.php 0000777 00000001506 15227040311 0015233 0 ustar 00 <?php namespace App\Http\Requests\Admin\Role; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class StoreRoleRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { $user = auth()->guard('admin')->user(); if ($user && $user->hasPermissionTo('create-roles', 'admin')) { return true; } return false; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { return [ 'name' => ['required', 'min:3', Rule::unique('roles')], 'permissions' => ['array'], ]; } } Http/Requests/Admin/Role/EditRoleRequest.php 0000777 00000001306 15227040311 0015022 0 ustar 00 <?php namespace App\Http\Requests\Admin\Role; use Illuminate\Foundation\Http\FormRequest; class EditRoleRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { $user = auth()->guard('admin')->user(); if ($user && $user->hasPermissionTo('edit-roles', 'admin')) { return true; } return false; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/Role/UpdateRoleRequest.php 0000777 00000001702 15227040311 0015357 0 ustar 00 <?php namespace App\Http\Requests\Admin\Role; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class UpdateRoleRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('edit-roles', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { return [ 'name' => ['required', 'min:3', Rule::unique('roles')->ignore($this->role)], 'permissions' => ['array'], ]; } } Http/Requests/Admin/Role/CreateRoleRequest.php 0000777 00000001312 15227040311 0015335 0 ustar 00 <?php namespace App\Http\Requests\Admin\Role; use Illuminate\Foundation\Http\FormRequest; class CreateRoleRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { $user = auth()->guard('admin')->user(); if ($user && $user->hasPermissionTo('create-roles', 'admin')) { return true; } return false; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/Company/StoreCompanyRequest.php 0000777 00000002521 15227040311 0016443 0 ustar 00 <?php namespace App\Http\Requests\Admin\Company; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class StoreCompanyRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('create-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ 'name' => ['required', Rule::unique('companies')->whereNull('deleted_at')], 'email' => ['required', Rule::unique('companies')->whereNull('deleted_at')], 'mobile' => ['required', 'min:10', Rule::unique('companies')->whereNull('deleted_at'),], 'address' => ['required'], 'city' => ['required'], 'state' => ['required'], 'country' => ['required'], 'pincode' => ['required'], 'plan' =>['required'], ]; } } Http/Requests/Admin/Company/UpdateCompanyRequest.php 0000777 00000002521 15227040311 0016571 0 ustar 00 <?php namespace App\Http\Requests\Admin\Company; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class UpdateCompanyRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('edit-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { $id = $this->route('company'); return [ 'name' => ['required', Rule::unique('companies')->ignore($id)], 'email' => ['required', Rule::unique('companies')->ignore($id)], 'mobile' => ['required', 'min:10', Rule::unique('companies')->ignore($id)], 'address' => ['required'], 'city' => ['required'], 'state' => ['required'], 'country' => ['required'], 'pincode' => ['required'], 'plan' => ['required'], ]; } } Http/Requests/Admin/Company/CreateCompanyRequest.php 0000777 00000001507 15227040311 0016555 0 ustar 00 <?php namespace App\Http\Requests\Admin\Company; use Illuminate\Foundation\Http\FormRequest; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class CreateCompanyRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('create-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/Company/ListCompanyRequest.php 0000777 00000001131 15227040311 0016256 0 ustar 00 <?php namespace App\Http\Requests\Admin\Company; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Foundation\Http\FormRequest; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class ListCompanyRequest extends FormRequest { public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('list-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } public function rules(): array { return []; } } Http/Requests/Admin/BlogCategory/UpdateBlogCategoryRequest.php 0000777 00000002302 15227040311 0020514 0 ustar 00 <?php namespace App\Http\Requests\Admin\BlogCategory; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class UpdateBlogCategoryRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('edit-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { $id = $this->route('blog_category'); return [ 'title' => [ 'required', 'min:3', Rule::unique('blog_categories')->ignore($id), ], 'slug' => [ 'required', 'min:3', Rule::unique('blog_categories')->ignore($id), ], ]; } } Http/Requests/Admin/BlogCategory/ListBlogCategoryRequest.php 0000777 00000001143 15227040311 0020207 0 ustar 00 <?php namespace App\Http\Requests\Admin\BlogCategory; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Foundation\Http\FormRequest; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class ListBlogCategoryRequest extends FormRequest { public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('list-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } public function rules(): array { return []; } } Http/Requests/Admin/BlogCategory/CreateBlogCategoryRequest.php 0000777 00000001521 15227040311 0020477 0 ustar 00 <?php namespace App\Http\Requests\Admin\BlogCategory; use Illuminate\Foundation\Http\FormRequest; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class CreateBlogCategoryRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('create-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ // ]; } } Http/Requests/Admin/BlogCategory/StoreBlogCategoryRequest.php 0000777 00000002110 15227040311 0020363 0 ustar 00 <?php namespace App\Http\Requests\Admin\BlogCategory; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; use Spatie\Permission\Exceptions\PermissionDoesNotExist; class StoreBlogCategoryRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { try { $user = auth()->guard('admin')->user(); return $user && $user->hasPermissionTo('create-blog-category', 'admin'); } catch (PermissionDoesNotExist $e) { return false; } } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */ public function rules(): array { return [ 'title' => ['required', 'min:3', Rule::unique('blog_categories')], 'slug' => ['required', 'min:3', Rule::unique('blog_categories')], 'status' => ['required'], 'image' => ['required'], ]; } } Http/Controllers/Api/ApiController.php 0000777 00000000741 15227040311 0013774 0 ustar 00 <?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; class ApiController extends Controller { /** * Function to send response * * @param array $data * @param int $code * @param string $message * @return Response */ public function sendResponse($data = [], $code = 200, $message = "") { return response()->json([ 'data' => $data, 'message' => $message ], $code); } } Http/Controllers/Api/BookController.php 0000777 00000002442 15227040311 0014155 0 ustar 00 <?php namespace App\Http\Controllers\Api; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Services\BookService; class BookController extends ApiController { private $bookService; function __construct() { $this->bookService = new BookService(); } /** * function to get list of boooks * * @param Request $request * @return JSON */ public function list(Request $request) { $page = $request->get('page', 1); $limit = $request->get('limit', 20); $search = $request->get('search', null); $orderBy = $request->get('order_by', null); $category = $request->get('category', null); $filters = [ 'search' => $search, 'page' => $page, 'limit' => $limit, 'orderBy' => $orderBy, 'category' => $category ]; $books = $this->bookService->getBookListByFilters($filters); return $this->sendResponse($books); } /** * Function to get single book detail * * @param Request $request * @param int $id * @return JSON */ function detail(Request $request, $id) { $book = $this->bookService->getBookById($id); return $this->sendResponse($book); } } Http/Controllers/Api/AuthController.php 0000777 00000002566 15227040311 0014173 0 ustar 00 <?php namespace App\Http\Controllers\Api; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Requests\Api\LoginRequest; use App\Services\BookService; use App\Services\CategoryService; use App\Services\UserService; use Illuminate\Support\Facades\Hash; class AuthController extends ApiController { private $userService; function __construct() { $this->userService = new UserService(); } /** * Function to login * * @return JSON */ public function login(LoginRequest $request) { $email = $request->get('email'); $password = $request->get('password'); // Getting User for Auth $user = $this->userService->getUserForAuth([ 'email' => $email, ]); // If user not found if (!$user) { $this->sendResponse([], 500, 'No User found!'); } // Checking password if (!Hash::check($password, $user->password)) { $this->sendResponse([], 500, 'Password does not match!'); } // Revoking existing token and creating new one $user->tokens()->delete(); $token = $user->createToken('app-login'); $user->token = $token->plainTextToken; // Unsetting extra data unset($user->created_at, $user->updated_at); return $this->sendResponse($user); } } Http/Controllers/Api/SettingsController.php 0000777 00000003010 15227040311 0015053 0 ustar 00 <?php namespace App\Http\Controllers\Api; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Services\BookService; use App\Services\CategoryService; class SettingsController extends ApiController { private $categoryService; function __construct() { $this->categoryService = new CategoryService(); } /** * Function to get App Settings * * @return JSON */ public function index() { $settings = []; $settings['categories'] = $this->categoryService->getList(); $settings['states'] = [ 'Andhra Pradesh', 'Assam', 'Arunachal Pradesh', 'Bihar', 'Gujrat', 'Haryana', 'Himachal Pradesh', 'Jammu & Kashmir', 'Karnataka', 'Kerala', 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', 'Nagaland', 'Orissa', 'Punjab', 'Rajasthan', 'Sikkim', 'Tamil Nadu', 'Tripura', 'Uttar Pradesh', 'West Bengal', 'Delhi', 'Goa', 'Pondichery', 'Lakshdweep', 'Daman & Diu', 'Dadra & Nagar', 'Chandigarh', 'Andaman & Nicobar', 'Uttaranchal', 'Jharkhand', 'Chattisgarh' ]; return $this->sendResponse($settings); } } Http/Controllers/Auth/LoginController.php 0000777 00000003126 15227040311 0014523 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Book; use App\Cart; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; use Session; class LoginController extends Controller { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ use AuthenticatesUsers; /** * Where to redirect users after login. * * @var string */ protected $redirectTo = '/books'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest')->except('logout'); } public function logout(Request $request) { $this->guard()->logout(); $oldCart = Session::get('cart'); $cart = new Cart($oldCart); $books = Book::all(); if ($cart->items > 0) { foreach ($cart->items as $item) { foreach ($books as $book) { if ($book->id == $item['item']['id']) { $book->increment('quantity', $cart->items[$book->id]['qty']); } } } } $request->session()->invalidate(); return redirect('/'); } } Http/Controllers/Auth/ResetPasswordController.php 0000777 00000001514 15227040311 0016257 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset requests | and uses a simple trait to include this behavior. You're free to | explore this trait and override any methods you wish to tweak. | */ use ResetsPasswords; /** * Where to redirect users after resetting their password. * * @var string */ protected $redirectTo = RouteServiceProvider::HOME; } Http/Controllers/Auth/ConfirmPasswordController.php 0000777 00000002000 15227040311 0016561 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\ConfirmsPasswords; class ConfirmPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Confirm Password Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password confirmations and | uses a simple trait to include the behavior. You're free to explore | this trait and override any functions that require customization. | */ use ConfirmsPasswords; /** * Where to redirect users when the intended url fails. * * @var string */ protected $redirectTo = RouteServiceProvider::HOME; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } } Http/Controllers/Auth/RegisterController.php 0000777 00000003564 15227040311 0015245 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\User; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; class RegisterController extends Controller { /* |-------------------------------------------------------------------------- | Register Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users as well as their | validation and creation. By default this controller uses a trait to | provide this functionality without requiring any additional code. | */ use RegistersUsers; /** * Where to redirect users after registration. * * @var string */ protected $redirectTo = RouteServiceProvider::HOME; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * Get a validator for an incoming registration request. * * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'], ]); } /** * Create a new user instance after a valid registration. * * @return \App\Models\User */ protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); } } Http/Controllers/Auth/VerificationController.php 0000777 00000002152 15227040311 0016073 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\VerifiesEmails; class VerificationController extends Controller { /* |-------------------------------------------------------------------------- | Email Verification Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling email verification for any | user that recently registered with the application. Emails may also | be re-sent if the user didn't receive the original email message. | */ use VerifiesEmails; /** * Where to redirect users after verification. * * @var string */ protected $redirectTo = RouteServiceProvider::HOME; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); $this->middleware('signed')->only('verify'); $this->middleware('throttle:6,1')->only('verify', 'resend'); } } Http/Controllers/Auth/ForgotPasswordController.php 0000777 00000001233 15227040311 0016433 0 ustar 00 <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; class ForgotPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset emails and | includes a trait which assists in sending these notifications from | your application to your users. Feel free to explore this trait. | */ use SendsPasswordResetEmails; } Http/Controllers/Admin/BlogCategoryController.php 0000777 00000013111 15227040311 0016156 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Requests\Admin\BlogCategory\CreateBlogCategoryRequest; use App\Http\Requests\Admin\BlogCategory\ListBlogCategoryRequest; use App\Http\Requests\Admin\BlogCategory\StoreBlogCategoryRequest; use App\Http\Requests\Admin\BlogCategory\UpdateBlogCategoryRequest; use App\Models\BlogCategory; use App\Repositories\BlogCategoryRepository\BlogCategoryRepository; use Illuminate\Support\Facades\DB; use Exception; use Illuminate\Http\Request; class BlogCategoryController extends Controller { public $blogCategoryRepository; public function __construct(BlogCategoryRepository $blogCategoryRepository) { $this->blogCategoryRepository = $blogCategoryRepository; } public function index(Request $request) { // echo 'daf'; // die; $blogCategories = $this->blogCategoryRepository->paginate(); return view('admin.blog_category.list', compact('blogCategories')); } /** * Show the form for creating a new resource. */ public function create(CreateBlogCategoryRequest $request) { return view('admin.blog_category.create'); } /** * Store a newly created resource in storage. */ public function store(StoreBlogCategoryRequest $request) { try { DB::beginTransaction(); if ($request->hasFile('image')) { $file = $request->file('image'); $originalName = $file->getClientOriginalName(); $file->storeAs('images/blogcategory', $originalName, 'public'); $blogImagePath = 'storage/images/blogcategory/' . $originalName; } $blogData = [ 'title' => $request->title, 'slug' => $request->slug, 'status' => $request->status ? 1 : 0, 'description' => $request->description, 'image' => $blogImagePath ?? null, ]; $blogCategory = $this->blogCategoryRepository->create($blogData); if ($blogCategory) { DB::commit(); toastr()->success('Blog category created successfully'); return redirect(route('admin.blog-categories.index')); } else { DB::rollBack(); toastr()->error('Problem in performing action!'); return redirect(route('admin.blog-categories.create')); } } catch (Exception $e) { DB::rollBack(); toastr()->error($e->getMessage()); return redirect(route('admin.blog-categories.create')); } } /** * Display the specified resource. */ public function show(string $id) { $blogCategoy = $this->blogCategoryRepository->getOne($id); return view('admin.blog_category.show', compact('blogCategoy')); } /** * Show the form for editing the specified resource. */ public function edit(string $id) { $blogCategory = $this->blogCategoryRepository->getOne($id); return view('admin.blog_category.edit', compact('blogCategory')); } /** * Update the specified resource in storage. */ public function update(UpdateBlogCategoryRequest $request, string $id) { try { DB::beginTransaction(); if ($request->hasFile('image')) { $file = $request->file('image'); $originalName = $file->getClientOriginalName(); $file->storeAs('images/blogcategory', $originalName, 'public'); $blogImagePath = 'storage/images/blogcategory/' . $originalName; } $blogCategoy = $this->blogCategoryRepository->getOne($id); $blogData = [ 'title' => $request->title, 'slug' => $request->slug, 'status' => $request->status ? 1 : 0, 'description' => $request->description, 'image' => $blogImagePath ?? $blogCategoy->image, ]; $isUpdated = $this->blogCategoryRepository->update($id, $blogData); if ($isUpdated) { DB::commit(); toastr()->success('Blog category updated successfully'); return redirect(route('admin.blog-categories.index')); } else { DB::rollBack(); toastr()->error('Problem in performing action!'); return redirect(route('admin.blog-categories.edit')); } } catch (Exception $e) { DB::rollBack(); toastr()->error($e->getMessage()); return redirect(route('admin.blog-categories.edit')); } } /** * Remove the specified resource from storage. */ public function destroy(string $id) { try { $this->blogCategoryRepository->destroy($id); toastr()->success('Blog category deleted successfully.'); return redirect(route('admin.blog-categories.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.blog-categories.index')); } } public function updateStatus($id) { $BlogCategory = BlogCategory::find($id); if (!empty($BlogCategory)) { updateStatus($BlogCategory); return response()->json(['status' => true, 'message' => trans('Status update successfully')]); } else { return response()->json(['status' => false, 'message' => trans('messages.error')]); } } } Http/Controllers/Admin/LoginController.php 0000777 00000003172 15227040311 0014653 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; class LoginController extends Controller { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ use AuthenticatesUsers; /** * Where to redirect users after login. * * @var string */ protected $redirectTo = RouteServiceProvider::ADMIN_DASHBOARD; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest')->except('logout'); } /** * Show the application's login form. * * @return \Illuminate\View\View */ public function showLoginForm() { return view('admin.auth.login'); } /** * Get the guard to be used during authentication. * * @return \Illuminate\Contracts\Auth\StatefulGuard */ protected function guard() { return auth()->guard('admin'); } /** * The user has logged out of the application. * * @return mixed */ protected function loggedOut(Request $request) { return redirect(route('admin.login')); } } Http/Controllers/Admin/OrderController.php 0000777 00000003337 15227040311 0014661 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\Order; use Illuminate\Http\Request; class OrderController extends Controller { public function index(Request $request) { $search = $request->input('search'); $status = $request->input('status'); $query = Order::with(['book', 'user', 'requestToUser']); if (!empty($search)) { $query->where(function ($q) use ($search) { $q->where('id', 'like', "%{$search}%") ->orWhere('customer_name', 'like', "%{$search}%") ->orWhereHas('book', function ($q2) use ($search) { $q2->where('title', 'like', "%{$search}%"); }) ->orWhereHas('user', function ($q3) use ($search) { $q3->where('name', 'like', "%{$search}%"); }) ->orWhereHas('requestToUser', function ($q4) use ($search) { $q4->where('name', 'like', "%{$search}%"); }); }); } if (!empty($status)) { $query->where('status', $status); } $orders = $query->orderBy('id', 'desc')->paginate(10); return view('admin.orders.index', compact('orders', 'search', 'status')); } public function show($id) { try { $order = Order::with(['book', 'user', 'requestToUser'])->findOrFail($id); return view('admin.orders.show', compact('order')); } catch (\Exception $e) { return redirect()->route('admin.orders.index') ->with('error', 'Order not found: ' . $e->getMessage()); } } } Http/Controllers/Admin/AdminController.php 0000777 00000014503 15227040311 0014633 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\Admin; use Illuminate\Http\Request; use App\Repositories\AdminRepository\AdminRepository; use App\Repositories\RoleRepository\RoleRepository; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Hash; use Spatie\Permission\Models\Role; class AdminController extends Controller { protected $AdminRepository; protected $roleRepository; public function __construct(AdminRepository $AdminRepository, RoleRepository $roleRepository) { $this->AdminRepository = $AdminRepository; $this->roleRepository = $roleRepository; } public function index(Request $request) { $search = $request->input('search'); $status = $request->input('status'); $admins = $this->AdminRepository->searchAndPaginate($search, $status, 50); return view('admin.admin.index', compact('admins', 'search', 'status')); } public function create() { $roles = $this->roleRepository->get(); return view('admin.admin.create', compact('roles')); } public function store(Request $request) { try { $validated = Validator::make($request->all(), [ 'name' => 'required|string|max:255', 'email' => 'required|email|unique:admins,email', 'password' => 'required|min:6', 'status' => 'boolean', 'role_id' => 'required|exists:roles,id', 'profile_image' => 'nullable|mimes:jpg,png,jpeg', ]); if ($validated->fails()) { return back() ->withErrors($validated) ->withInput(); } $ImagePath = null; if ($request->hasFile('profile_image')) { $file = $request->file('profile_image'); $originalName = time() . '_' . $file->getClientOriginalName(); // avoid duplicate $file->storeAs('images/profile_image', $originalName, 'public'); $ImagePath = 'storage/images/profile_image/' . $originalName; } $adminData = [ 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), 'status' => $request->status ? 1 : 0, 'image' => $ImagePath, ]; $admin = $this->AdminRepository->create($adminData); if ($request->role_id) { $role = Role::find($request->role_id); if ($role) { $admin->assignRole($role->name); } } return redirect() ->route('admin.admin.index') ->with('success', 'Admin created successfully with role.'); } catch (\Exception $e) { return redirect() ->route('admin.admin.index') ->with('error', 'Failed to create admin: ' . $e->getMessage()); } } public function edit($id) { $admin = $this->AdminRepository->getOne($id); $roles = $this->roleRepository->get(); return view('admin.admin.edit', compact('admin', 'roles')); } public function update(Request $request, $id) { // dd($request->all()); try { $validated = Validator::make($request->all(), [ 'name' => 'required|string|max:255', 'email' => 'required|email|unique:admins,email,' . $id, 'status' => 'boolean', 'role_id' => 'required|exists:roles,id', 'profile_image' => 'nullable|mimes:jpg,png,jpeg', ]); if ($validated->fails()) { return back() ->withErrors($validated) ->withInput(); } $ImagePath = null; if ($request->hasFile('profile_image')) { $file = $request->file('profile_image'); $originalName = time() . '_' . $file->getClientOriginalName(); $file->storeAs('images/profile_image', $originalName, 'public'); $ImagePath = 'storage/images/profile_image/' . $originalName; } $adminData = [ 'name' => $request->name, 'email' => $request->email, 'status' => $request->status ? 1 : 0, 'image' => $ImagePath, ]; $this->AdminRepository->update($id, $adminData); $admin = Admin::findOrFail($id); if ($request->role_id) { $role = Role::find($request->role_id); if ($role) { $admin->syncRoles([$role->name]); } } return redirect() ->route('admin.admin.index') ->with('success', 'Admin update successfully with role.'); } catch (\Exception $e) { return redirect() ->route('admin.admin.index') ->with('error', 'Failed to update admin: ' . $e->getMessage()); } } public function show($id){ $admin = $this->AdminRepository->getOne($id); $roles = $this->roleRepository->get(); return view('admin.admin.show', compact('admin', 'roles')); } public function destroy(string $id) { try { $this->AdminRepository->destroy($id); toastr()->success('Admin deleted successfully.'); return redirect(route('admin.admin.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.admin.index')); } } public function updateStatus($id){ $admin = $this->AdminRepository->getOne($id); if (!empty($admin)) { updateStatus($admin); $statusText = $admin->status ? 'Active' : 'Deactivate'; return response()->json(['status' => $admin->status ? true : false, 'message' => trans('Status updated successfully', ['value' => $statusText])]); } else { return response()->json(['status' => false, 'message' => trans('messages.error')]); } } } Http/Controllers/Admin/BookController.php 0000777 00000011554 15227040311 0014500 0 ustar 00 <?php namespace App\Http\Controllers\admin; use App\Http\Controllers\Controller; use App\Models\Book; use App\Models\Category; use Illuminate\Http\Request; use App\Repositories\BookRepository\BookRepository; use App\Repositories\BookRepository\BookRepository as BookRepositoryBookRepository; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Hash; use Spatie\Permission\Models\Role; class BookController extends Controller { protected $bookRepository; public function __construct(BookRepository $bookRepository) { $this->bookRepository = $bookRepository; } public function index(Request $request) { $search = $request->input('search'); $status = $request->input('status'); $books = $this->bookRepository->searchAndPaginate($search, $status, 50); $book = $this->bookRepository->get(); return view('admin.books.index', compact('books', 'search', 'status', 'book')); } public function edit($id) { $book = $this->bookRepository->getOne($id); $categories = Category::get(); return view('admin.books.edit', compact('book', 'categories')); } public function update(Request $request, $id) { try { $validator = Validator::make( $request->all(), [ 'title' => 'required|string|max:255', 'book_type' => 'required|in:1,2,3', 'author' => 'required|string|max:255', 'location' => 'nullable|string|max:255', 'price' => 'required|numeric|min:0', 'offer_price' => 'required|numeric|min:0', 'type' => 'required|string|max:255', 'quantity' => 'required|integer|min:1', 'contact' => 'required|numeric', 'category_id' => 'nullable|integer', ], [ 'title.required' => 'Please enter book title', 'book_type.required' => 'Please select a book type', 'author.required' => 'Please enter author name', 'location.required' => 'Please enter location', 'price.required' => 'Please enter price', 'offer_price.required' => 'Please enter offer price', 'type.required' => 'Please enter book type', 'quantity.required' => 'Please enter quantity', 'contact.required' => 'Please enter contact number', 'category_id.required' => 'Please select category', ] ); if ($validator->fails()) { return back() ->withErrors($validator) ->withInput(); } // ✅ Get validated data as array $validated = $validator->validated(); $bookData = [ 'title' => $validated['title'], 'book_type' => $validated['book_type'], 'author' => $validated['author'], 'location' => $validated['location'], 'price' => $validated['price'], 'offer_price' => $validated['offer_price'], 'type' => $validated['type'], 'quantity' => $validated['quantity'], 'contact' => $validated['contact'], 'category_id' => $validated['category_id'], ]; if ($validated['category_id'] == 40) { $bookData['category_name'] = $request->input('category_name'); } else { $category = Category::find($validated['category_id']); $bookData['category_name'] = $category ? $category->name : null; } $this->bookRepository->update($id, $bookData); return redirect() ->route('admin.books.index') ->with('success', 'Book updated successfully!'); } catch (\Exception $e) { return redirect() ->back() ->withInput() ->with('error', 'Something went wrong: ' . $e->getMessage()); } } public function show($id){ $book = $this->bookRepository->getOne($id); $categories = Category::get(); return view('admin.books.show', compact('book', 'categories')); } public function destroy(string $id) { try { $this->bookRepository->destroy($id); toastr()->success('Book deleted successfully.'); return redirect(route('admin.books.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.books.index')); } } } Http/Controllers/Admin/CategoryController.php 0000777 00000006406 15227040311 0015363 0 ustar 00 <?php namespace App\Http\Controllers\admin; use App\Http\Controllers\Controller; use App\Repositories\CategoryRepository\CategoryRepository; use Illuminate\Http\Request; use Illuminate\Support\Facades\Validator; class CategoryController extends Controller { protected $categoryRepository; public function __construct(CategoryRepository $categoryRepository) { $this->categoryRepository = $categoryRepository; } public function index(Request $request) { $search = $request->input('search'); $categories = $this->categoryRepository->searchAndPaginate($search, 50); return view('admin.category.index', compact('categories')); } public function create() { return view('admin.category.create'); } public function store(Request $request) { try { $validated = Validator::make($request->all(), [ 'name' => 'required|string|max:255', ]); if ($validated->fails()) { return back() ->withErrors($validated) ->withInput(); } $categoryData = [ 'name' => $request->name, ]; $admin = $this->categoryRepository->create($categoryData); return redirect() ->route('admin.category.index') ->with('success', 'Category created successfully.'); } catch (\Exception $e) { return redirect() ->route('admin.category.index') ->with('error', 'Failed to create category: ' . $e->getMessage()); } } public function edit($id) { $category = $this->categoryRepository->getOne($id); return view('admin.category.edit', compact('category')); } public function update(Request $request, $id) { try { $validated = Validator::make($request->all(), [ 'name' => 'required|string|max:255', ]); if ($validated->fails()) { return back() ->withErrors($validated) ->withInput(); } $categoryData = [ 'name' => $request->name, ]; $admin = $this->categoryRepository->update($id, $categoryData); return redirect() ->route('admin.category.index') ->with('success', 'Category updated successfully.'); } catch (\Exception $e) { return redirect() ->route('admin.category.index') ->with('error', 'Failed to update category: ' . $e->getMessage()); } } public function show($id) { $category = $this->categoryRepository->getOne($id); return view('admin.category.show', compact('category')); } public function destroy(string $id) { try { $this->categoryRepository->destroy($id); toastr()->success('Category deleted successfully.'); return redirect(route('admin.category.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.category.index')); } } } Http/Controllers/Admin/DashboardController.php 0000777 00000001646 15227040311 0015476 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\ContactUS; use Illuminate\Http\Request; class DashboardController extends Controller { public function index() { // dd(auth()->guard('admin')->user()->getAllPermissions()); return view('admin.dashboard'); } public function contact(Request $request) { $query = ContactUS::query(); if ($request->has('q') && $request->q != '') { $search = $request->q; $query->where(function ($q) use ($search) { $q->where('name', 'LIKE', "%{$search}%") ->orWhere('email', 'LIKE', "%{$search}%") ->orWhere('message', 'LIKE', "%{$search}%"); }); } $contact = $query->orderBy('created_at', 'desc')->paginate(10); return view('admin.contact', compact('contact')); } } Http/Controllers/Admin/EditProfileController.php 0000777 00000003354 15227040311 0016013 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Models\Admin; // Correct model use Illuminate\Support\Facades\Validator; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class EditProfileController extends Controller { public function create($id){ $user = Admin::find($id); return view('admin.profile.edit',compact('user')); } public function update(Request $request, $id){ $validator = Validator::make( $request->all(), array( 'name' => 'required|string|max:255', 'email' => 'required|email|unique:users,email,' . $id, 'profile_image' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', ), array( "name.required" => 'Please enter name', "email.required" => 'Please enter email', ) ); if ($validator->fails()) { return redirect()->back()->withErrors($validator)->withInput(); } else { $user = Admin::find($id); $profileImagePath = $user->profile_image; if ($request->hasFile('profile_image')) { $imageName = time() . '.' . $request->profile_image->extension(); $request->profile_image->move(public_path('uploads/profiles'), $imageName); $profileImagePath = 'uploads/profiles/' . $imageName; } $user->name = $request->name; $user->email = $request->email; $user->image = $profileImagePath; $user->save(); return redirect()->route('admin.edit.profile',auth()->user()->id)->with('success', 'Profile updated successfully'); } } } Http/Controllers/Admin/UserController.php 0000777 00000012161 15227040311 0014517 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\User; use App\Repositories\UserRepository\UserRepository; use Illuminate\Http\Request; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Hash; class UserController extends Controller { protected $userRepository; public function __construct(UserRepository $userRepository) { $this->userRepository = $userRepository; } public function index(Request $request) { $search = $request->input('search'); $status = $request->input('status'); $users = $this->userRepository->searchAndPaginate($search, $status, 50); return view('admin.user.index', compact('users', 'search', 'status')); } public function create() { return view('admin.user.create'); } public function store(Request $request) { try { $validated = Validator::make($request->all(), [ 'name' => 'required|string|max:255', 'email' => 'required|email|unique:users,email', 'password' => 'required|min:6', ]); if ($validated->fails()) { return back() ->withErrors($validated) ->withInput(); } // $ImagePath = null; // if ($request->hasFile('profile_image')) { // $file = $request->file('profile_image'); // $originalName = time() . '_' . $file->getClientOriginalName(); // avoid duplicate // $file->storeAs('images/profile_image', $originalName, 'public'); // $ImagePath = 'storage/images/profile_image/' . $originalName; // } $userData = [ 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), 'status' =>$request->status ? 1 : 0, ]; $user = $this->userRepository->create($userData); // if ($request->role_id) { // $role = Role::find($request->role_id); // if ($role) { // $admin->assignRole($role->name); // } // } return redirect() ->route('admin.user.index') ->with('success', 'user created successfully with role.'); } catch (\Exception $e) { return redirect() ->route('admin.user.index') ->with('error', 'Failed to create user: ' . $e->getMessage()); } } public function edit($id){ $user = $this->userRepository->getOne($id); return view('admin.user.edit', compact('user')); } public function update(Request $request, $id){ try { $validated = Validator::make($request->all(), [ 'name' => 'required|string|max:255', 'email' => 'required|email|unique:admins,email,' . $id, 'status' => 'boolean', ]); if ($validated->fails()) { return back() ->withErrors($validated) ->withInput(); } // $ImagePath = null; // if ($request->hasFile('profile_image')) { // $file = $request->file('profile_image'); // $originalName = time() . '_' . $file->getClientOriginalName(); // $file->storeAs('images/profile_image', $originalName, 'public'); // $ImagePath = 'storage/images/profile_image/' . $originalName; // } $userData = [ 'name' => $request->name, 'email' => $request->email, ]; $this->userRepository->update($id, $userData); $admin = User::findOrFail($id); // if ($request->role_id) { // $role = Role::find($request->role_id); // if ($role) { // $admin->syncRoles([$role->name]); // } // } return redirect() ->route('admin.user.index') ->with('success', 'User update successfully with role.'); } catch (\Exception $e) { return redirect() ->route('admin.user.index') ->with('error', 'Failed to update user: ' . $e->getMessage()); } } public function show($id){ $user = $this->userRepository->getOne($id); return view('admin.user.show', compact('user')); } public function destroy(string $id) { try { $this->userRepository->destroy($id); toastr()->success('user deleted successfully.'); return redirect(route('admin.user.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.user.index')); } } } Http/Controllers/Admin/SettingsController.php 0000777 00000002545 15227040311 0015406 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use Illuminate\Support\Facades\Validator; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class SettingsController extends Controller { public function updateTitles(Request $request) { $request->validate([ 'admin_title' => 'required|string|max:255', 'frontend_title' => 'required|string|max:255', ]); setSetting('admin_title', $request->admin_title); setSetting('frontend_title', $request->frontend_title); return back()->with('success', 'Titles updated successfully!'); } public function updateFavicons(Request $request) { $request->validate([ 'admin_favicon' => 'nullable|image|mimes:png,ico,jpg,jpeg|max:2048', 'frontend_favicon' => 'nullable|image|mimes:png,ico,jpg,jpeg|max:2048', ]); if ($request->hasFile('admin_favicon')) { $path = $request->file('admin_favicon')->store('settings', 'public'); setSetting('admin_favicon', 'storage/' . $path); } if ($request->hasFile('frontend_favicon')) { $path = $request->file('frontend_favicon')->store('settings', 'public'); setSetting('frontend_favicon', 'storage/' . $path); } return back()->with('success', 'Favicons updated successfully!'); } } Http/Controllers/Admin/BlogController.php 0000777 00000015206 15227040311 0014467 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Requests\Admin\Blog\ListBlogRequest; use App\Http\Requests\Admin\Blog\CreateBlogRequest; use App\Http\Requests\Admin\Blog\StoreBlogRequest; use App\Http\Requests\Admin\Blog\UpdateBlogRequest; use App\Models\Blog; use App\Repositories\BlogRepository\BlogRepository; use App\Repositories\BlogCategoryRepository\BlogCategoryRepository; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Exception; class BlogController extends Controller { public $blogRepository; public $blogCategoryRepository; public function __construct(BlogRepository $blogRepository, BlogCategoryRepository $blogCategoryRepository) { $this->blogRepository = $blogRepository; $this->blogCategoryRepository = $blogCategoryRepository; } public function index(ListBlogRequest $request) { $blogs = $this->blogRepository->paginate(); return view('admin.blog.list', compact('blogs')); } /** * Show the form for creating a new resource. */ public function create(CreateBlogRequest $request) { $blogCategories = $this->blogCategoryRepository->get(); return view('admin.blog.create', compact('blogCategories')); } /** * Store a newly created resource in storage. */ public function store(StoreBlogRequest $request) { // dd($request->all()); try { DB::beginTransaction(); if ($request->hasFile('image')) { $file = $request->file('image'); $originalName = $file->getClientOriginalName(); $file->storeAs('images/blogcategory', $originalName, 'public'); $blogImagePath = 'storage/images/blogcategory/' . $originalName; } $blogData = [ 'title' => $request->title, 'description' => $request->description, 'slug' => $request->slug, 'status' => $request->status ? 1 : 0, 'image' => $blogImagePath ?? null, 'created_by' => auth()->guard('admin')->user()->id ?? 0 ]; $blog = $this->blogRepository->create($blogData); if (!empty($request->blog_category)) { $this->blogRepository->createBlogCategory($blog->id, $request->blog_category); } if ($blog) { DB::commit(); toastr()->success('Blog created successfully'); return redirect(route('admin.blogs.index')); } else { DB::rollBack(); toastr()->error('Problem in performing action!'); return redirect(route('admin.blogs.index')); } } catch (Exception $e) { DB::rollBack(); toastr()->error($e->getMessage()); return redirect(route('admin.blogs.index')); } } /** * Display the specified resource. */ public function show(string $id) { $blog = $this->blogRepository->getOne($id); return view('admin.blog.show', compact('blog')); } /** * Show the form for editing the specified resource. */ public function edit(string $id) { $blog = $this->blogRepository->getOne($id); $blogCategories = $this->blogCategoryRepository->get(); return view('admin.blog.edit', compact('blog', 'blogCategories')); } /** * Update the specified resource in storage. */ public function update(UpdateBlogRequest $request, string $id) { try { DB::beginTransaction(); if ($request->hasFile('image')) { $file = $request->file('image'); $originalName = $file->getClientOriginalName(); $file->storeAs('images/blogcategory', $originalName, 'public'); $blogImagePath = 'storage/images/blogcategory/' . $originalName; } $blog = $this->blogRepository->getOne($id); $blogData = [ 'title' => $request->title, 'description' => $request->description, 'slug' => $request->slug, 'image' => $blogImagePath ?? $blog->image, 'status' => $request->status ? $request->status : 0, 'created_by' => auth()->guard('admin')->user()->id ?? 0 ]; $isUpdated = $this->blogRepository->update($id, $blogData); if (!empty($request->blog_category)) { $this->blogRepository->createBlogCategory($id, $request->blog_category); } if ($isUpdated) { DB::commit(); toastr()->success('Blog updated successfully'); return redirect(route('admin.blogs.index')); } else { DB::rollBack(); toastr()->error('Problem in performing action!'); return redirect(route('admin.blogs.index')); } } catch (Exception $e) { DB::rollBack(); toastr()->error($e->getMessage()); return redirect(route('admin.blogs.index')); } } /** * Remove the specified resource from storage. */ public function destroy(string $id) { try { $this->blogRepository->destroy($id); toastr()->success('Blog deleted successfully.'); return redirect(route('admin.blogs.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.blogs.index')); } } public function uploadImage(Request $request) { if ($request->hasFile('upload')) { $file = $request->file('upload'); $filename = time() . '_' . $request->file('upload')->getClientOriginalName(); $path = $request->file('upload')->storeAs('blogs', $filename, 'public'); $url = asset('storage/blogs/' . $filename); return response()->json([ 'uploaded' => true, 'url' => $url, 'path' => $path ]); } return response()->json([ 'uploaded' => false, 'error' => ['message' => 'File not uploaded.'] ]); } public function updateStatus($id) { $blog = Blog::find($id); if (!empty($blog)) { updateStatus($blog); return response()->json(['status' => true, 'message' => trans('Status updated successfully')]); } else { return response()->json(['status' => false, 'message' => trans('messages.error')]); } } } Http/Controllers/Admin/RolesController.php 0000777 00000012030 15227040311 0014660 0 ustar 00 <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Http\Requests\Admin\Role\CreateRoleRequest; use App\Http\Requests\Admin\Role\EditRoleRequest; use App\Http\Requests\Admin\Role\ShowRoleRequest; use App\Http\Requests\Admin\Role\StoreRoleRequest; use App\Http\Requests\Admin\Role\UpdateRoleRequest; use App\Models\Role; use App\Repositories\PermissionRepository\PermissionRepository; use App\Repositories\RoleRepository\RoleRepository; use Exception; use Illuminate\Support\Facades\DB; class RolesController extends Controller { /** * Property to store roles repository object * * @var RolesRepository */ protected $rolesRepository; /** * Property to store permissions repository object * * @var PermissionRepository; */ protected $permissionRepository; public function __construct(RoleRepository $rolesRepository, PermissionRepository $permissionRepository) { $this->rolesRepository = $rolesRepository; $this->permissionRepository = $permissionRepository; } /** * Display a listing of the resource. */ public function index() { $roles = $this->rolesRepository->paginate(); return view('admin.roles.list', compact('roles')); } /** * Show the form for creating a new resource. */ public function create(CreateRoleRequest $request) { $permissions = $this->permissionRepository->get(); $permissionList = []; foreach ($permissions as $permission) { $permissionList[$permission->module][] = $permission; } return view('admin.roles.create', compact('permissionList')); } /** * Store a newly created resource in storage. */ public function store(StoreRoleRequest $request) { try { $createdRole = DB::transaction(function () use ($request) { $role = $this->rolesRepository->create([ 'name' => $request->name, 'guard_name' => 'admin', ]); $permissions = $this->permissionRepository->getPermissionsByIds(array_keys($request->permissions)); $role->givePermissionTo($permissions); return $role; }); if ($createdRole) { toastr()->success('Role Creatd Successfully'); return redirect(route('admin.roles.index')); } else { toastr()->error('Problem in performing action!'); return redirect()->back(); } } catch (Exception $e) { toastr()->error($e->getMessage()); return redirect()->back(); } } /** * Display the specified resource. */ public function show(ShowRoleRequest $request, Role $role) { $permissionList = []; foreach ($role->permissions as $permission) { $permissionList[$permission->module][] = $permission; } return view('admin.roles.show', compact('role', 'permissionList')); } /** * Show the form for editing the specified resource. */ public function edit(EditRoleRequest $request, Role $role) { $permissions = $this->permissionRepository->get(); $permissionList = []; foreach ($permissions as $permission) { $permissionList[$permission->module][] = $permission; } $rolePermissions = $role->permissions->pluck('id')->toArray(); return view('admin.roles.edit', compact('role', 'permissionList', 'rolePermissions')); } /** * Update the specified resource in storage. */ public function update(UpdateRoleRequest $request, Role $role) { try { $createdRole = DB::transaction(function () use ($request, $role) { $role->name = $request->name; $role->save(); $permissions = $this->permissionRepository->getPermissionsByIds(array_keys($request->permissions)); $role->syncPermissions($permissions); return $role; }); if ($createdRole) { toastr()->success('Role Updated Successfully'); return redirect(route('admin.roles.index')); } else { toastr()->error('Problem in performing action!'); return redirect()->back(); } } catch (Exception $e) { toastr()->error($e->getMessage()); return redirect()->back(); } } /** * Remove the specified resource from storage. */ public function destroy(Role $role) { try { $role->permissions()->detach(); $this->rolesRepository->destroy($role->id); toastr()->success('Role deleted successfully.'); return redirect(route('admin.roles.index')); } catch (Exception $e) { toastr()->error('Problem in performing action!'); return redirect(route('admin.roles.index')); } } } Http/Controllers/AdminController.php 0000777 00000013362 15227040311 0013605 0 ustar 00 <?php namespace App\Http\Controllers; use Auth; use App\Book; use App\User; use App\Order; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Cmgmyr\Messenger\Models\Thread; //use Illuminate\Support\Facades\Request; use Cmgmyr\Messenger\Models\Message; use Illuminate\Support\Facades\Config; use Cmgmyr\Messenger\Models\Participant; class AdminController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $id = Auth::id(); $orders = Order::orderBy('created_at', 'desc')->where('orders.request_to', $id)->paginate(15); $orders->transform(function ($order, $key) { $order->bookcart = unserialize($order->bookcart); return $order; }); $orderstatus = Config::get('app.orderstatus'); //echo "<pre>";print_r($orders); return view('admin')->with('orders', $orders)->with('id', $id)->with('orderstatus', $orderstatus); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { } /** * Update the specified resource in storage. * * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $Order = Order::findOrFail($id); $Order->status = $request->input('status'); $Order->save(); if ($Order->status == 2) { // Cancelling all other order for book Order::where('book_id', $Order->book_id)->where('user_id', '!=', $Order->user_id)->update([ 'status' => 3 ]); Book::where('id', $Order->book_id)->first()->decrement('quantity'); } return redirect('/admin')->with('success', 'Order Updated'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } public function view_requestbook(Request $request, $id) { // print_r($id);exit(); $book = Order::findOrFail($id); // dd($book); $countries = Config::get('app.countries'); $thread = Thread::where('order_id', $id)->first(); // dd($thread); $users = ''; if ($thread) { $action = route('messages.updateordermessege', $thread->id); $userId = Auth::id(); $users = User::whereNotIn('id', $thread->participantsUserIds($userId))->get(); $thread->markAsRead($userId); $is_thread = true; } else { $action = route('messages.ordermessege', $id); $thread = Thread::create([ 'subject' => 'Order Chat #'.$id, 'order_id' => $id, ]); $is_thread = true; } $orderstatus = Config::get('app.orderstatus'); return view('books.view')->with('book', $book)->with('action', $action)->with('thread', $thread)->with('users', $users)->with('is_thread', $is_thread)->with('orderstatus', $orderstatus)->with('countries', $countries); } public function updateordermessege_func(Request $request, $thread_id) { $thread = Thread::findOrFail($thread_id); $order = Order::where('id', $thread->order_id)->first(); //echo $order->request_to; exit; Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => $request->message, ]); $participant = Participant::firstOrCreate([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), ]); $participant->last_read = new Carbon(); $participant->save(); $thread->addParticipant($order->request_to); return redirect('/admin/requestbook/'.$thread->order_id)->with('success', 'Message Updated'); } public function ordermessege_func(Request $request, $order_id) { //$input = Request::all(); $book = Order::findOrFail($order_id); $thread = Thread::create([ 'subject' => 'Order Chat #'.$order_id, 'order_id' => $order_id, ]); DB::table('threads') ->where('id', $thread->id) ->update(['order_id' => $order_id]); // Message Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => $request->message, ]); // Sender Participant::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'last_read' => new Carbon(), ]); // Recipients //if (Request::has('recipients')) { $thread->addParticipant([$book->user_id]); //} return redirect('/admin/requestbook/'.$order_id)->with('success', 'Message Updated'); } //////////////// for order ///////////////////////////////////////// } Http/Controllers/QueryController.php 0000777 00000001231 15227040311 0013652 0 ustar 00 <?php namespace App\Http\Controllers; use DB; use Illuminate\Http\Request; class QueryController extends Controller { /** * Search a book by title, author, ISBN */ public function search(Request $request) { $query = $request->get('search'); $books = DB::table('books')->where('title', 'LIKE', '%'.$query.'%') ->orWhere('author', 'Like', '%'.$query.'%') ->orwhere('type', 'like', '%'.$query.'%') ->orwhere('ISBN', 'like', '%'.$query.'%') ->orwhere('price', 'like', '%'.$query.'%') ->paginate(5); return view('pages.search')->with('books', $books); } } Http/Controllers/BooksController.php 0000777 00000050532 15227040311 0013632 0 ustar 00 <?php namespace App\Http\Controllers; use App\Book; use App\Cart; use App\Category; use App\Events\CheckoutEvent; use App\Mail\CheckoutMail; use App\Notifications\CheckoutNotification; //use Stripe\Stripe; use App\Order; use App\User; use Auth; use Carbon\Carbon; use Cmgmyr\Messenger\Models\Message; use Cmgmyr\Messenger\Models\Participant; use Cmgmyr\Messenger\Models\Thread; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Mail; use Session; //use LVR\CreditCard\CardCvc; //use LVR\CreditCard\CardNumber; //use LVR\CreditCard\CardExpirationYear; //use LVR\CreditCard\CardExpirationMonth; class BooksController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth', ['except' => ['index', 'show', 'getAddToCart', 'getCart', 'getReduceByOne', 'getRemoveItem', 'orderByTitle', 'orderByAuthor', 'HighestToLowest', 'LowestToHighest', 'PriceLessThan50', 'PriceGreaterThan50', 'NewestToOldest', 'OldestToNewest']]); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $search = $request->get('search', null); $order = $request->get('order', null); $categories = Category::all(); $books = Book::where('id', '>', 0) ->where('quantity', '>', 0); if (!empty($order)) { $books = $books->orderBy('price', $order); } else { $books = $books->orderBy('created_at', 'desc'); } if (!empty($search)) { $books = $books->where(function ($query) use ($search) { $query->orWhere('title', 'like', "%".$search."%") ->orWhere('description', 'like', "%".$search."%") ->orWhereHas('category', function ($query) use ($search) { $query->where('name', 'like', "%".$search."%"); }); }); } $books = $books->paginate(8); return view('books.index') ->with('books', $books) ->with('categories', $categories) ->with('search', $search) ->with('order', $order); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $categories = Category::all(); return view('books.create')->with('categories', $categories); } /** * Store a newly created resource in storage. * * @return \Illuminate\Http\Response */ public function store(Request $request) { $this->validate($request, [ 'title' => 'required', 'description' => 'required', //'image' => 'image|nullable|max:1999', 'author' => 'required', //'publishedOn' => 'required|date|before:tomorrow', 'price' => 'required|regex:/^\d*(\.\d{1,2})?$/', // 'type' => 'required', //'ISBN' => ['somestimes|regex:/((978[\--– ])?[0-9][0-9\--– ]{10}[\--– ][0-9xX])|((978)?[0-9]{9}[0-9Xx])$/'], 'quantity' => 'required|numeric', // 'location' => 'required', 'category_id' => 'integer', //'contact' =>'required|numeric|min:10', ]); //Handles the uploading of the image if ($request->hasFile('image')) { //Gets the filename with the extension $fileNameWithExt = $request->file('image')->getClientOriginalName(); //just gets the filename $filename = pathinfo($fileNameWithExt, PATHINFO_FILENAME); //Just gets the extension $extension = $request->file('image')->getClientOriginalExtension(); //Gets the filename to store $fileNameToStore = $filename . '_' . time() . '.' . $extension; //Uploads the image $path = $request->file('image')->storeAs('public/image', $fileNameToStore); } else { $fileNameToStore = ''; } $Book = new Book; $Book->title = $request->input('title'); $Book->description = $request->input('description'); $Book->image = $fileNameToStore; $Book->author = $request->input('author'); $Book->publishedOn = $request->input('publishedOn'); $Book->price = $request->input('price'); $Book->offer_price = ($request->input('type') == 'donate' ? 0 : $request->input('offer_price')); $Book->type = ($request->input('book_type') == 3) ? 'buy_online' : $request->input('type'); $Book->ISBN = $request->input('ISBN'); $Book->quantity = $request->input('quantity'); $Book->location = $request->input('location'); $Book->category_id = $request->input('category_id'); $Book->contact = $request->input('contact'); $Book->image_url = $request->input('image_url'); $Book->book_type = $request->input('book_type'); $Book->download_url = $request->input('download_url'); $Book->category_name = $request->input('category_name'); $Book->user_id = auth()->user()->id; $Book->save(); return redirect('/dashboard')->with('success', 'Book Submitted'); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $book = Book::findOrFail($id); //print_r($book); exit; $category = ''; if ($book->category_id) { $category = Category::findOrFail($book->category_id); } // Checking if book already requested or not $isRequested = false; $userId = (auth()->user()) ? auth()->user()->id : null; if (!empty($userId)) { $order = Order::where('user_id', $userId) ->where('book_id', $id) ->first(); if ($order) { $isRequested = true; } else { $isRequested = false; } } return view('books.show')->with('book', $book)->with('category', $category)->with('isRequested', $isRequested); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function view_requestbook_order($id) { $book = Book::findOrFail($id); $categories = Category::all(); // if(auth()->user()->id !== $book->user_id){ // exit; // return redirect ('/books')->with('error', 'Unauthorised Page'); // } return view('books.OrderView')->with('book', $book)->with('categories', $categories); } public function edit($id) { $book = Book::findOrFail($id); $categories = Category::all(); if (auth()->user()->id !== $book->user_id) { return redirect('/books')->with('error', 'Unauthorised Page'); } return view('books.edit')->with('book', $book)->with('categories', $categories); } /** * Update the specified resource in storage. * * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $this->validate($request, [ 'title' => 'required', 'description' => 'required', 'author' => 'required', //'publishedOn' => 'required|date|before:tomorrow', 'price' => 'required|regex:/^\d*(\.\d{1,2})?$/', // 'type' => 'required', //'ISBN' => ['somestimes|regex:/((978[\--– ])?[0-9][0-9\--– ]{10}[\--– ][0-9xX])|((978)?[0-9]{9}[0-9Xx])$/'], 'quantity' => 'required|numeric', // 'location' => 'required', 'category_id' => 'integer', //'contact' => 'numeric', ]); //Handles the uploading of the image if ($request->hasFile('image')) { //Gets the filename with the extension $fileNameWithExt = $request->file('image')->getClientOriginalName(); //just gets the filename $filename = pathinfo($fileNameWithExt, PATHINFO_FILENAME); //Just gets the extension $extension = $request->file('image')->getClientOriginalExtension(); //Gets the filename to store $fileNameToStore = $filename . '_' . time() . '.' . $extension; //Uploads the image $path = $request->file('image')->storeAs('public/image', $fileNameToStore); } else { $fileNameToStore = 'noimage.jpg'; } $Book = Book::findOrFail($id); $Book->title = $request->input('title'); $Book->description = $request->input('description'); $Book->author = $request->input('author'); $Book->quantity = $request->input('quantity'); $Book->publishedOn = $request->input('publishedOn'); $Book->price = $request->input('price'); $Book->offer_price = ($request->input('type') == 'donate' ? 0 : $request->input('offer_price')); $Book->type = ($request->input('book_type') == 3) ? 'buy_online' : $request->input('type'); $Book->ISBN = $request->input('ISBN'); $Book->category_id = $request->input('category_id'); $Book->location = $request->input('location'); $Book->contact = $request->input('contact'); $Book->image_url = $request->input('image_url'); $Book->book_type = $request->input('book_type'); $Book->download_url = $request->input('download_url'); $Book->category_name = $request->input('category_name'); if ($request->hasFile('image')) { $Book->image = $fileNameToStore; } $Book->save(); return redirect('/dashboard')->with('success', 'Book Updated'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $book = Book::findOrFail($id); if (auth()->user()->id !== $book->user_id) { return redirect('/books')->with('error', 'Unauthorised Page'); } $book->delete(); return redirect('/dashboard')->with('success', 'Book Deleted'); } /** * Add an item to the shopping cart. * * @param int $id * @return \Illuminate\Http\Response */ public function getAddToCart(Request $request, $id) { $book = Book::findOrFail($id); $oldCart = Session::has('cart') ? Session::get('cart') : null; $cart = new Cart($oldCart); //echo "<pre>"; print_r($cart); exit; if (!empty($cart->items)) { if (count($cart->items) > 0) { foreach ($cart->items as $cart_item) { $cart->removeItem($cart_item['item']['id']); } } } $cart->add($book, $book->id); $request->session()->put('cart', $cart); //return redirect()->back()->with('success', 'Added book'); // return redirect('/checkout')->with('success', 'Added book'); return redirect('/#exampleModalLong')->with('success', 'Added book'); } /** * Reduce an item by one in the shopping cart * * @param int $id * @return \Illuminate\Http\Response */ public function getReduceByOne($id) { $book = Book::findOrFail($id); $book->increment('quantity'); $oldCart = Session::has('cart') ? Session::get('cart') : null; $cart = new Cart($oldCart); $cart->reduceByOne($id); if (count($cart->items) > 0) { Session::put('cart', $cart); } else { Session::forget('cart'); } // $book->increment('quantity'); return redirect()->back()->with('success', 'Reduced by one'); } /** * Remove an item from the shopping cart. * * @param int $id * @return \Illuminate\Http\Response */ public function getRemoveItem($id) { $book = Book::findOrFail($id); $oldCart = Session::has('cart') ? Session::get('cart') : null; $cart = new Cart($oldCart); $book->increment('quantity', $cart->items[$id]['qty']); $cart->removeItem($id); if (count($cart->items) > 0) { Session::put('cart', $cart); } else { Session::forget('cart'); } return redirect()->back()->with('success', 'Removed Item'); } /** * Get shopping cart */ public function getCart() { if (!Session::has('cart')) { return view('cart.index', ['books' => null]); } $oldCart = Session::get('cart'); $cart = new Cart($oldCart); return view('cart.index', ['books' => $cart->items, 'totalPrice' => $cart->totalPrice]); } /** * Get the checkout */ public function getCheckout() { if (!Session::has('cart')) { return view('cart.index', ['books' => null]); } $oldCart = Session::get('cart'); $cart = new Cart($oldCart); $total = $cart->totalPrice; return view('cart.checkout')->with('total', $total); } /** * Post checkout stripe payment. * * @param int $id * @return \Illuminate\Http\Response */ public function postcheckout(Request $request) { $this->validate($request, [ 'address' => 'required|regex:/(^[-0-9A-Za-z.,\/ ]+$)/', 'phone' => 'required|max:10', ]); if (!Session::has('cart')) { return redirect()->back(); } $oldCart = Session::get('cart'); $cart = new Cart($oldCart); //Stripe::setApiKey('sk_test_eO1eHIzneDLjxooZHBoQFDUR'); //try { // $token = $_POST['stripeToken']; // $charge = \Stripe\Charge::create([ // "amount" => $cart->totalPrice * 100, // "currency" => "gbp", // "source" => 'tok_visa', // obtained with Stripe.js // "description" => "Test Charge // 'source' => $token, // ]); $order = new Order(); $order->bookcart = serialize($cart); $order->address = $request->input('address'); $order->phone = $request->input('phone'); $order->name = $request->input('name'); $order->status = 'Order Placed'; //$order->order_payment_id = $charge->id; Auth::user()->orders()->save($order); //} catch (\Exception $e) { // return redirect('/books')->with('error', $e->getMessage()); // } Session::forget('cart'); //auth()->user()->notify(new CheckoutNotification); //mail::to($users->books->email)->send( //new CheckoutMail($books)); event(new CheckoutEvent('Someone')); //dd($user->books->email); return redirect('/books')->with('success', 'Contact Owner for the books!!!'); // return redirect('/books')->with('total', $total); } public function checkoutrequestbook(Request $request) { $book_id = $request->input('book_id'); $book_order_check = Order::where('orders.book_id', $book_id) ->where('orders.user_id', auth()->user()->id) ->first(); if ($book_order_check) { return response()->json(['status' => true, 'success' => ' Owner for the books!!']); } $book = Book::findOrFail($book_id); $oldCart = Session::has('cart') ? Session::get('cart') : null; $cart = new Cart($oldCart); if (!empty($cart->items)) { if (count($cart->items) > 0) { foreach ($cart->items as $cart_item) { $cart->removeItem($cart_item['item']['id']); } } } $cart->add($book, $book->id); $request->session()->put('cart', $cart); $oldCart = Session::get('cart'); $cart = new Cart($oldCart); $user_book = User::where('id', $book->user_id)->first(); //echo "<pre>"; print_r($user_book->email); exit; $order = new Order(); $order->bookcart = serialize($cart); $order->address = ''; $order->phone = ''; $order->book_id = $book->id; $order->name = Auth::user()->name; $order->request_to = $book->user_id; $order->status = 'Order Placed'; //$order->order_payment_id = $charge->id; Auth::user()->orders()->save($order); Session::forget('cart'); $uemail = $user_book->email; /************ Chat Message ****************/ $order_id = $order->id; //$book = Order::findOrFail($order_id); $thread = Thread::create([ 'subject' => 'Order Chat #' . $order_id, 'order_id' => $order_id, ]); DB::table('threads') ->where('id', $thread->id) ->update(['order_id' => $order_id]); // Message Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => 'Book ' . $book->title . ' requested order placed', ]); // Sender Participant::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'last_read' => new Carbon(), ]); Participant::create([ 'thread_id' => $thread->id, 'user_id' => $book->user_id, 'last_read' => new Carbon(), ]); $thread->addParticipant([$book->user_id]); //user_id $data = [ 'book_name' => $book->title, 'book_owner' => $book->author, 'book_requester' => $order->name, ]; $email_subject = 'Request for Book ' . $book->title; Mail::send('email.bookrequest', $data, function ($message) use ($uemail, $email_subject) { $message->to($uemail) ->subject($email_subject); }); return response()->json(['status' => true, 'success' => ' Owner for the books!!']); } /** * Order a book by its title */ public function orderByTitle() { $categories = Category::all(); $books = Book::orderBy('title')->paginate(10); return view('books.orderByTitle')->with('books', $books)->with('categories', $categories); } /** * Order a book by its author */ public function orderByAuthor() { $categories = Category::all(); $books = Book::orderBy('author')->paginate(10); return view('books.orderByAuthor')->with('books', $books)->with('categories', $categories); } /** * Filters books that are greater than £50 */ public function PriceGreaterThan50() { $categories = Category::all(); $books = Book::PriceGreaterThan(50)->paginate(10); return view('books.PriceGreaterThan50')->with('books', $books)->with('categories', $categories); } /** * Filters books that are less than £50 */ public function PriceLessThan50() { $categories = Category::all(); $books = Book::PriceLessThan(50)->paginate(10); return view('books.PriceLessThan50')->with('books', $books)->with('categories', $categories); } /** * Order the price of books by highest to lowest */ public function HighestToLowest() { $categories = Category::all(); $books = Book::orderBy('price', 'desc')->paginate(10); return view('books.HighestToLowest')->with('books', $books)->with('categories', $categories); } /** * Order the price of books by lowest to highest */ public function LowestToHighest() { $categories = Category::all(); $books = Book::orderBy('price', 'asc')->paginate(10); return view('books.LowestToHighest')->with('books', $books)->with('categories', $categories); } /** * Order book by newest to oldest */ public function NewestToOldest() { $categories = Category::all(); $books = Book::orderBy('created_at', 'desc')->paginate(10); return view('books.NewestToOldest')->with('books', $books)->with('categories', $categories); } /** * Order book by oldest to newest */ public function OldestToNewest() { $categories = Category::all(); $books = Book::orderBy('created_at', 'asc')->paginate(10); return view('books.OldestToNewest')->with('books', $books)->with('categories', $categories); } } Http/Controllers/CategoryController.php 0000777 00000002337 15227040311 0014332 0 ustar 00 <?php namespace App\Http\Controllers; use App\Category; use Illuminate\Http\Request; class CategoryController extends Controller { public function __construct() { $this->middleware('auth', ['except' => ['index', 'show']]); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $categories = Category::all(); return view('categories.index')->with('categories', $categories); } /** * Store a newly created resource in storage. * * @return \Illuminate\Http\Response */ public function store(Request $request) { $this->validate($request, [ 'name' => 'required|max:255', ]); $Category = new Category; $Category->name = $request->input('name'); $Category->save(); return redirect('/categories')->with('success', 'Category Added'); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $books = Category::findorfail($id)->books; return view('categories.show')->with('books', $books); } } Http/Controllers/DashboardController.php 0000777 00000012520 15227040311 0014437 0 ustar 00 <?php namespace App\Http\Controllers; use App\Book; use App\Order; use App\User; use Auth; use Carbon\Carbon; use Cmgmyr\Messenger\Models\Message; use Cmgmyr\Messenger\Models\Participant; use Cmgmyr\Messenger\Models\Thread; use Illuminate\Http\Request; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\DB; class DashboardController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function index() { $user_id = auth()->user()->id; $user = User::find($user_id); $books = Book::where('user_id', $user_id)->paginate(15); return view('dashboard')->with('books', $books); } // Display the order made by the student public function orders() { $orders = Auth::user()->orders->sortByDesc('created_at'); $orders = Order::where('user_id', Auth::user()->id)->orderBy('created_at', 'DESC')->paginate(15); $orders->transform(function ($order, $key) { $order->bookcart = unserialize($order->bookcart); return $order; }); $orderstatus = Config::get('app.orderstatus'); return view('orders', ['orders' => $orders, 'orderstatus' => $orderstatus]); } public function view_order_func(Request $request, $id) { $book = Order::findOrFail($id); $book_data = unserialize($book->bookcart); //echo "<pre>";print_r($book_data->items);exit(); //$book_data = $book = Book::findOrFail($id); $countries = Config::get('app.countries'); $thread = Thread::where('order_id', $id)->first(); $users = ''; if ($thread) { $action = route('dashboard.updateordermessege', $thread->id); $userId = Auth::id(); $users = User::whereNotIn('id', $thread->participantsUserIds($userId))->get(); $thread->markAsRead($userId); $is_thread = true; } else { $action = route('dashboard.ordermessege', $id); $is_thread = false; } $orderstatus = Config::get('app.orderstatus'); return view('order_view')->with('book', $book)->with('action', $action)->with('thread', $thread)->with('users', $users)->with('is_thread', $is_thread)->with('orderstatus', $orderstatus)->with('countries', $countries); } public function updateordermessege_func(Request $request, $thread_id) { $thread = Thread::findOrFail($thread_id); $order = Order::where('id', $thread->order_id)->first(); //echo $order->request_to; exit; Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => $request->message, ]); $participant = Participant::firstOrCreate([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), ]); $participant->last_read = new Carbon(); $participant->save(); $thread->addParticipant($order->request_to); return redirect('/orders/vieworder/'.$thread->order_id)->with('success', 'Message Updated'); } public function ordermessege_func(Request $request, $order_id) { //$input = Request::all(); $book = Order::findOrFail($order_id); $thread = Thread::create([ 'subject' => 'Order Chat #'.$order_id, 'order_id' => $order_id, ]); DB::table('threads') ->where('id', $thread->id) ->update(['order_id' => $order_id]); // Message Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => $request->message, ]); // Sender Participant::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'last_read' => new Carbon(), ]); // Recipients //if (Request::has('recipients')) { $thread->addParticipant([$book->user_id]); //} return redirect('/orders/vieworder/'.$order_id)->with('success', 'Message Updated'); } public function profile(Request $request) { $user_id = auth()->user()->id; $user = User::find($user_id); //echo "<pre>"; print_r($user); echo "</pre>"; $countries = Config::get('app.countries'); return view('user')->with(['user' => $user, 'countries' => $countries]); } public function profileupdate(Request $request) { $request->validate([ 'name' => 'required|string|max:255', 'lname' => 'required|string|max:255', 'lname' => 'required|string|max:12', ]); $user = Auth::user(); $user->name = $request['name']; $user->lname = $request['lname']; $user->phone_number = $request['phone_number']; $user->country = $request['country']; $user->state = $request['state']; $user->pincode = $request['pincode']; $user->about_us = $request['about_us']; $user->save(); $user_id = auth()->user()->id; $user = User::find($user_id); return redirect('/profile')->with('success', 'Profile Updated'); } } Http/Controllers/ContactusController.php 0000777 00000002320 15227040311 0014510 0 ustar 00 <?php namespace App\Http\Controllers; use App\ContactUS; use Illuminate\Http\Request; use Mail; class ContactusController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('pages.contact'); } /** * Store a newly created resource in storage. * * @return \Illuminate\Http\Response */ public function store(Request $request) { $this->validate($request, [ 'name' => 'required', 'email' => 'required|email', 'message' => 'required', ]); ContactUS::create($request->all()); Mail::send('email', [ 'name' => $request->get('name'), 'email' => $request->get('email'), 'user_message' => $request->get('message'), ], function ($message) { $message->from('support@bookdonate.digiauxilio.com'); $message->to('support@bookdonate.digiauxilio.com', 'Admin') ->subject('Contact Form Query'); }); return back()->with('success', 'Thanks for contacting us!'); } } Http/Controllers/MessagesController.php 0000777 00000007766 15227040311 0014337 0 ustar 00 <?php namespace App\Http\Controllers; use App\User; use Carbon\Carbon; use Cmgmyr\Messenger\Models\Message; use Cmgmyr\Messenger\Models\Participant; use Cmgmyr\Messenger\Models\Thread; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Session; class MessagesController extends Controller { /** * Show all of the message threads to the user. * * @return mixed */ public function index() { // All threads, ignore deleted/archived participants //$threads = Thread::getAllLatest()->get(); // All threads that user is participating in $threads = Thread::forUser(Auth::id())->latest('updated_at')->paginate(15); // All threads that user is participating in, with new messages // $threads = Thread::forUserWithNewMessages(Auth::id())->latest('updated_at')->get(); return view('messenger.index', compact('threads')); } /** * Shows a message thread. * * @return mixed */ public function show($id) { try { $thread = Thread::findOrFail($id); } catch (ModelNotFoundException $e) { Session::flash('error_message', 'The thread with ID: '.$id.' was not found.'); return redirect()->route('messages'); } // show current user in list if not a current participant // $users = User::whereNotIn('id', $thread->participantsUserIds())->get(); // don't show the current user in list $userId = Auth::id(); $users = User::whereNotIn('id', $thread->participantsUserIds($userId))->get(); $thread->markAsRead($userId); $threads = Thread::forUser(Auth::id())->latest('updated_at')->get(); return view('messenger.show', compact('thread', 'users', 'threads')); } /** * Creates a new message thread. * * @return mixed */ public function create() { $users = User::where('id', '!=', Auth::id())->get(); return view('messenger.create', compact('users')); } /** * Stores a new message thread. * * @return mixed */ public function store() { $input = Request::all(); $thread = Thread::create([ 'subject' => $input['subject'], ]); // Message Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => $input['message'], ]); // Sender Participant::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'last_read' => new Carbon(), ]); // Recipients if (Request::has('recipients')) { $thread->addParticipant($input['recipients']); } return redirect()->route('messages'); } /** * Adds a new message to a current thread. * * @return mixed */ public function update($id) { try { $thread = Thread::findOrFail($id); } catch (ModelNotFoundException $e) { Session::flash('error_message', 'The thread with ID: '.$id.' was not found.'); return redirect()->route('messages'); } $thread->activateAllParticipants(); // Message Message::create([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), 'body' => Request::input('message'), ]); // Add replier as a participant $participant = Participant::firstOrCreate([ 'thread_id' => $thread->id, 'user_id' => Auth::id(), ]); $participant->last_read = new Carbon(); $participant->save(); // Recipients if (Request::has('recipients')) { $thread->addParticipant(Request::input('recipients')); } return redirect()->route('messages.show', $id); } } Http/Controllers/Controller.php 0000777 00000000727 15227040311 0012635 0 ustar 00 <?php namespace App\Http\Controllers; use Cmgmyr\Messenger\Models\Thread; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\View; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; } Http/Controllers/HomeController.php 0000777 00000000665 15227040311 0013447 0 ustar 00 <?php namespace App\Http\Controllers; class HomeController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function index() { return view('home'); } } Http/Controllers/BlogController.php 0000777 00000001013 15227040311 0013426 0 ustar 00 <?php namespace App\Http\Controllers; use App\Models\Blog; use Illuminate\Http\Request; use Illuminate\Support\Facades\File; class BlogController extends Controller { public function index() { $bloglisting = Blog::latest('created_at')->paginate(50); return view('blog.index', compact('bloglisting')); } public function show(Request $request, $slug) { $blogDetails = Blog::where('slug', $slug)->firstOrFail(); return view('blog.show', compact('blogDetails')); } } Http/Controllers/PagesController.php 0000777 00000003342 15227040311 0013611 0 ustar 00 <?php namespace App\Http\Controllers; use App\Book; use Cmgmyr\Messenger\Models\Thread; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class PagesController extends Controller { /** * Return index page of books */ public function index() { $books = Book::orderBy('created_at', 'desc')->where('quantity', '>', 0)->paginate(12); // Getting category with max books $category = Book::select(DB::raw('count(id) AS TotalBooks'), 'category_id') ->groupBy('category_id') ->orderBy('TotalBooks', 'DESC') ->first(); $categoryBooks = null; if (!empty($category)) { $categoryBooks = Book::orderBy('created_at', 'desc') ->where('quantity', '>', 0) ->where('category_id', $category->category_id) ->paginate(12); } return view('pages.home')->with('books', $books)->with('categoryBooks', $categoryBooks); } /** * Return about page of books */ public function about() { return view('pages.about'); } /** * Return contact page of books */ public function contact() { return view('pages.contact'); } /** * Function to get unread count * * @return JSON */ public function unreadCount() { $responseData = [ 'success' => true, 'count' => 0, ]; $unreadCount = null; if (auth()->user()) { $unreadCount = Thread::forUserWithNewMessages(auth()->user()->id)->latest('updated_at')->get()->count(); } $responseData['count'] = $unreadCount; return response()->json($responseData); } } Http/Controllers.zip 0000777 00000072355 15227040311 0010533 0 ustar 00 PK �[ Controllers/Admin/PK �[,B�V C % Controllers/Admin/AdminController.php�XKo�6��Wp�9�Hv�E����M���A�H�ͬ$�$��h��;C�v�vl��`�����7��Ţ�r�1UИ����~Ѻ�~��"M�Tӓ$��+���x#�U$,���۳4-aA5�.ٟ%S�R�d�P\əSܼY��[�.E�jJ�e�UYB��)�i�Д'D_��B�� ]Ts6�`2�Jq��=dz!hqJ�"}&��"ի�_=O!�f�f �w<n�˖sf��KyLfek�Bnoc�+-�X�-{�"�W���9��ħ�\ 'm��[��T�vQ��˳�#�'l:���V�����ض"� ϋR��� 5XJS]*���iS��{0��N��� }B�&Z����`rcS2]ʜ<p����4��E��ݦ�7k7��8��X2DҹD�|͙�E's�Ú�[�Z�u����¶^�P �V���TH�c����(�� ؛;�i"r���'��T�� P�K�<A��|�����磣 �j���Roh���2�ado+��CԆG!��c4G����u�רt' �4�I�5�� -�K�����@ƇP�G�C�P=/ӔޥB������}��-7u���g$��n8�A\T8��Ǵ;s�m?��#�R �jVw �������&��zA5�u�uaðU���'�G}hԘ�Ou�U�ކ�$� X4�=���i�L��r���4�J }<!IY@�A��Рpa:��00P�aY��Ǧ�r=�څ���q�nx�혔�D5�{%vn��+�+��W��D�)@k��^i\�~�DF�G�J�*ҭ����k�Q؛����x��{p���z�G��k�}6�] �:�Y��[y{��ϻ�� �A��а�u��OG� c�����c�L�6!v�7!nceEP� ��z�<�NZ���e� �"��p�p��a���:1�#b�����.����v��:��3}�DJ8�<gF�6�}��Quf+��>�KY`���.P$�nBN��\RC��p"C��U��F���e����6�tU܀�Oʽ�x����2�e�l-6}��ۙ�\b#�������Z�1�V�um��1�3�4֯��;È����,��YD-ģaՏ2� ��ǐ�; pY�Uh��o��L[�\��w�B [� (o�:B%,e����h'M�S��]��΄����3� &gBfj���;�.K�+S`[,��4�b�e�^��f�N�<��4���;[j<~]��m 8�P�!�>1����7��J"WC~�D^oZ ���i-Kfg4Uؐ3��FVK��,n�D�H��LI��E�7��S��V�v�݁˽R�5t�=��PK �[ao% � , Controllers/Admin/BlogCategoryController.php�VYo7~ׯ`�2t��V#�G�h��n�� ���rKrc��{��C{�҇6ჭ%g��\���d�1�@'��N��/�$�[%� ���A��`�����y]��JA����F��-5��j��U�?�[�� 6~�ڜg�Hu&�Ipȑ{H��x��K������[!R�O�i�He�o(�Z���D^�0H�E�**U� �5�^���q��nk��J�'�>��� �i�,��d��J���38r�����5דE�0yՏ�*o;��8�?���G��ٌ [K�4������z?&�"ڇx�H��e��(0���gϾGm�M��#����&#�V�{�K�Ѩ���]\d�/��Z>�J�?����P�3^�e�Ls�YgȜ����Ń�e��~l�fX�&���1�D�]p� ����� ���ˮ����'���h���^M�]<$~aq�XS���=!L�Uâ]�%l�ZaUe�V���:�#�[E+?Y��� �yW9n�+/�,\X�u~������z��2&^�N<V�5�5���:,�<2�ۮ�־��;j(Z�غ�3��ȫE%xnoܖ�"]5D�V���&�MY�I��O�ء���wl�P��t�eiv�8^]�8��������O��eTG9��oU��^m E�t����a�R�@c}٦#E��6ΏCtq�5�ؕӇ��+@�S2E�"������K.,֖����택t7�}��(%��W�I@d9'e �Ѩ��·_0a���dk�#����}^5=f��� �5]8~���w\'�n�\� 0� � rh>zaC?�A빰��#z�c/������=�7'Mb��_�{\��/�����(�������=uV��7xɽc����{M�|���-�|�τj''���u�;��罆1����-m�o�4G�?{34-���1�����\��H~����q#��(��36���@g&�tt��Ь�i��O�h�����Ӌ��B̳��PK W�[�4f� � $ Controllers/Admin/BlogController.php�X[o�6~��`���^��A��X�m-��F�mn���T���9�,K��A����H�_����bU9͘.h�Ȼ���lL1���QR��]��t0(u����Mt�.�6������/\|���T�vύ��@�?��O�5+�� �3=w���s җ@��v���B�`ܶL�\ޔE!���� MA�Յ#��1a��3��5���T�hX�j�=|x��^��=���� �E�'����%2�F������u�I8"}�FV����Yq}<k%gaW<��ֳ�~>��y�c���P���Ũ@����dz�.m����h�L�r8�X�d���I"3�eGVt4m����GGN��Y�bV�,���I��x�$���iY��M*�i�a���N�� *4G�n��gKf����G`�hW(p\8�ź�(���� t�L(����� �tJ�4��Ϩ�ᨁ�R�suqrrϠ$~W4��jm�� �+��s��g`>�����p���k�d9�2@<�.�o�9��m�.g��ظ�ͫ�l���J��b��*��Ɩ�1�\��� ��U�$O#2i�n|j}Y�W�P����82���Y#x�lܥ��(ng��Ѹ �iQ.=< QjJ���CrN~ '�m�˥�2��x~N�R� K�!w�k�GK��GP %UiՓ|�Rx�S���%��9X �:��ò¬���w������*r�ё1�S�WQ�)�>dv5̬��P�Iaybu�$LC��i���N��56GG@5/K�b0�,!��ɩ'viE#�� ���.h��n��RR��'%��p�Lᾱ[�ί7�lt��D 7Ɋ�5"C���+�C7�~�hC��Qݢ�����J��tm�.X������C��c0�<�ip����1�^��.��W�A��e!�K�D�W��[�4�'Xj{C��IO��F(��w�֩�ژ��s<�"���: 9��k����$�U�gc��� b�o p�v]��'��Ρ���9�4�l��^��)���'��/��6�_�7ιf��һ�Jf�m6=F�8�]_=M���}%�2���tj�eq�'����+6���!ij�v�_�ZP>p2� �l�=�,y�`��a�Fwv�H�ڢ���Ԁ�!�ƚ|hK-� �Tk@�5n�R؈�͢.d�Vß�X`�;Yj��Qeh��n��K�}w��ֺ�mUI���}m�s[{dK��~�27��W�uCri�F�$��Y7F= �� PK �[tR2�� l $ Controllers/Admin/BookController.php�W_o�6��`� ;M��ř]t]���X� {�����6YTI����q�b�n�dG�%Rv�w�����;�w�&�2����<_~R*_~�<MA�%M�,;� 9��~�7J_x�\���3��*Xs�/�Ӵ�p�D��oH�Z]B�%S\0(��}��Kl��;�ô��*�����4A�?h���G5?Q�)��r�,/@l���guj.y ��8��t��-�{Y"I;5�sDp�+�$d|���)�ɪ�b�k����gR�"Va/=��ؗ��1V&������j�G��,K�>�6��E��,$��x��+��ey� �ѹ���*�W�H:��U��e�(��g�]�m+_&�:rv��[� -m���`�d��NL^� ���"�n�q�X���QT'ڛiH� �,�s���XZQ���� �͞�v�������ES�ތ>qpW�k/���g�^�R�9��ٖ�A��4� �h����Q����(�R�� 4�<�qc�aK�go��� �ܨ}^�t X6{3y;�aȔj�E���N9�f:h �"M�m O���ϊ-���0;�����M��xA�4�-ܷ���4ax3d�UU!�+|ZV��%A/��������v���E ��"���Pr�?;`��;��ޑ�|�;�T�}E9F�.����}�'���q [H�Q;��$ٌ�-;���G��P�0�{90�A��z9[��l�g�bQ���~g&:u�� ۊ?]�(KeE���Gհni|F^w��S��Bp!-�Cʟ���j�z<v}|����_�7P����R}!�B�}G}�*͉[3��`�/q�)n�j��Z =�mQ�Y+�:-�6��>;�3�v��g�$۲�̜Nd��B��ӆ:yʍ�{l�F�t��mY�����1��=����1%�9���w�zZ��_�.�]���"�v��Y�κ»���=ls��f�w�t��dFt?X.��u/��v�� ���O,�x�vk�t!x�8���OY/|4qҼ3��z'��_aH�W�<�R���p��>��������x;P�;eu�o�5Z{}ŷ�i��d�}����3��ʼo�`t ad1j����;� �^���#J��G�H�gJ�}X^���v�GXCuC4��(��1]2&,y�`[���$8F�a�x���_�)ap!8^���e$��b��BM�^�G�U��/PK �[���� ( Controllers/Admin/CategoryController.php�V�k�0~�_���6�a��.ekY�J{YFQ�K"j[�$� k���,;Nb� �ۘ�l�~|��w�_��K�y�AKʀ�H9{o����Q"�@�Ms^{^�1h��7F� ��F(h@ ,�Zo>�{>9��,+1<��m:��J)�2�3�h�)>ӌ�� P�Q�I��EG`e�H�j���<R �@J|��ٔ�gd^�pQ��+& mT�Lح�/PT�q��͒�8��i?��Џ�)�-�+��ɨ�*���k�8�,M�� :n�k�A���8q�'EzAUw�:ψ��j��Q`JU�[waP�j��W#�D�RD@m� ���Jg lΦփ�9�`0����IJ ��}�ǿuZD5M�F��INo�� �4��hD����y�iB����(8^,�s���:: Fގ��m���s�x�dNy��(ڃlOM�5e75��'N�Y�*%�ފ:d|^�kKT���w k����DIK����a��j���k퀱t��I�N`7P����D��������W2Z��6�����n^f�z�=���<���Y�և��:�`�`!����5f҄����S�,�|�"�Gu��� D�&�y�YcM��bƏT\B6a�Z?��Ji��*F���}�싺��������w- ��y��^��ߺ4lX�?���M聫�q�M8|���Wa�?jNa+�2�ˠ�ާ�!���*a�����KK$��P��V��x>luk�PK �[H�HH� � ) Controllers/Admin/DashboardController.php�R�N�0��+��`G�,ז�E!.����&����â*����a?0�3��,~�*QQ���ba����Z�8.r�)Q��\di>������'!�(���KY:2f�a��U��:r.�1p�L�X0-zJ�W��0л�u�T�(SOe�mZ��_i\��Q}x��!(+mB��lY:vJ������J�~�s)�Qg�1���8����9<���bwD�*i����h;)us��l�C���7�BX�x\�h�&�O@;��,a���akz� 6�@�w`u�L����:��R��^�H�<t���%m9�R7�G���6���Sw6�-���߀�F�B�7`�X*��v�6l�{���V�U��a��~U�F -P�Q�5:%�f} ��{E)��N���_j����*!�+���wPK �[�b̟g z % Controllers/Admin/LoginController.php�TM��0��W�a%p_�m���n����� �;��|��ޱ� �!��!���f��ͻb]D�9�B$㢘��k���,Cc��4�jEζ�G��/Fod�O����ld��nw�e���F;� �Z�ǎ�ᅊd��e�ƕ@c�?ZbvI&���z%Ց�P��[������Ϟ�dp�¦��=����(w-T��q,�T+p����xDQd�D+� �`* &!��r {�S�61�j� �4s2 #$U8|�6�$�P�-I��ħ���!� ;8��Fa �:�e#���hУ�R*�bIL5�}T����a��a���0�L� S���5��s^��O>�^LƳ������ ��B)ܞ�O*KB%ؠe��Q��2}��=q�u�łј�K(��� 6G�*�)[b+Ɲ���N����;\V�����Zo_{�c�Zz?�m��'��M�6��(�r�0;7�S�Q��?���� 0i��诜0���zS��:��s���8#&�HȖ�����e�>A���6i�J̭)�J���zw�ćv�8w��u��D�r�e\"?8������Ѣ����I�[Uu��9� PK �[2� 7 � % Controllers/Admin/OrderController.php�T�o�0~�_a�Nq�������i�aE�K���������c;N����^�\�>����}sE�,@ ��br���|�LK^� ��XP6�"�l��6�P�ɍ,�ײ4�h�����-p^���@!Xi`�BW�!k�ܗ4GS�rM9C��� d}H|l��l���|�iF�0��8w�5�F� �_\�&�Fȵ �F�%�s|�s���؊�������@�����kx&I���4[�An��c�\y�ĭ�:�ɋiᨔ�����)dU�'�N��4��N͍�|��D�" 7��jx����lp�FS]�2ދQ���ϺϏ�x�R�k�^���M}��P�xվ��^E�O�3 ���Y3�}�6����ҽ����T'i&�����uw�$h#�Ma�c�ݰF��br����~�w�a_�SX�\�w?�9_�-�7��;�W�~9�}G/�4�Z�7�����#��a����V�� �D��'�W9/n �1� ��,��$����W��N� �� %� �~ĸFSnX1B1�k�l��"3�=��WT�PK �[7�D2 % Controllers/Admin/RolesController.php�WMo�8��W�@ Q��ޛƻI��h� �=�A��c�[YTIʉP���R�-Gr��Cbќᛙ7o菿%�d2��L�8��$Y�im���b�U�6�s����d��� ����k������ŵ�`�I��>ߎ��,�=��f���J��D��M ���V-^C���s$���4F��\�z��cK��kn�Cb�Y��%�RĎ�7i�(m0�:�����C�#SU����XR-M~N>�rL��J@یXE��#���% ��n�g�߷L�VЋ����V�@�#�܆x_��� �?�������!��,Ә��{��N���Bu���?-���pϑ]K3��<����L��;���ᮓ�Ki��e��H+�QKb��0*�N��l�H��h'��Hg�!r��a���l%<Ҁ�~=�v'X0%\mP�, �j�C!9�!,�?�;�r�1���мЎ�at��N�u��+�l�[��f��E�ۻ�[_�8���YX���>�o�H#���k��:�H�{˒�^��*��#ʊD��,H*/l�B��^�����h%�8�Yc*./>|��ņy��<���I1-=��x_:w2D��N�C�n��l^����Ҵ�*eZܗ6yY���Ş�YZ隹ȾC��,����֚ϰ�L� t'�P��K5��N:v��y�뮽].�<�r���*�rN��ܤ��14�-.�M��L�(z�(�hR�4�Z�X�FOx9�)��U�^@���4�i���u ���W-��w��������iB�ڄ3�Ĥ�g��N����������m$#P���y 9�6 p��5-xA P�i��Xv���Qr���z��WR]r{��ۙ�X4?_SgK[�C+0F��#�҇zՌ��!|�Rl�@� Ūs'���S��w�Q~\i!�È��@�G��{��_W���v�yZ04����R��3˰-�>�=��o9GM�_e�����!<��7�װQ�6^j�����UF�֎�9�,*q;�C��s_R��h' G;S��I���*ʽ��/S�n� :�&�PK �[��[-r q $ Controllers/Admin/UserController.php�W[o�6~��� � ;�d��"�4]��K]�D�D%R#�\����R֕�S`}P>�y.��x�o��HЌ�ƌ���1��F�4eJ�Γ���hT���yQ }� K��nnް\jn���UO�W�s�����9�7쟂i�;���s����4ӟi� v�J~�zW�S�5A�]{4L$��[�GV��a�a �KyLօ� �����Rh���kv DV�y�56[��˶9�E��9 {�ȑ�r{G�'ͨ��h��.���$� aCM����%�X���2ӥ3.�k��I K,��� 9}-j���B r��CP��4zb�LH,3�f c=�� �T��,Vq�4���mj�-��ރ���o�������HU��yF�A����4 � ����`w��ْ��K��(��<g�q���i0�k���Voi۳�Bp�0���8q���A�$�8��(�6�6+ _���t��:��N�p�y���2��5]>p�}��T�a���-�F��ڵ1�fd|�� ��{Ki��J؋T��R}�S0e��p�Q?��q�Q�Ոk�vϩՅA�-��%6Ϡ�� n����� 3�R΄�jHý� ��<!I�C�C�B�c���0���o��}��gx3���י���^�i�g��2;������uSy<{Q�*��E�L��X�1QN���ٲV+�[�+��7=�v�-<����謢���^��B�����c�v_�&�G�[#�HX�����5���T\*�vwG50�`� �G/ F}����Z-�i�e6�.� )��0W�������fW�c�[2���c`3����Y"'�>'�;�׀� �&�Q���S j�1d��G�p�F�ە`V��U�q<��8�3�ȑDz�î����O��L��d��NB�R�_����9��t�ǹ�9V��92H������Q��q��y�D�t��A�_��GЭ�Cu ��H��t �� ���w+:���\��2z9��=d ԧ�O�cBK�V��d?佩q�Ѝ�pFP��6p���O7[�=�Z_!����}\+y�����șZK�aL���/��2��PK �['��*� Controllers/AdminController.php�XMo�6��W�� R�8B[�bo�&Y,��6EҜ��i��,iI*�[�w�)��/��ևX&gF��7�ü��^փA�WT�8�謮��IYO/�R�((�f꼪��ׇ��BL�8������wU95_f�(�+���5��sC��M�4u]q9}�sL���;�!W�՚O?P!h���a�s�)&�A�����m�� ^�QA��l�;��K���/��K� /�茀Y��>IZ�ڡ�?���H�#ti�aT�G�����9=���WNe�K�P1b�2�]7w�Ѽ)sɪ�fMH��2=����s �L'+FHA1�i�a%��X�<b�����T͑\Rĩ����Q.�;+ }�f�"��ш�Ԃ�3�b��YM��H�>_�I��KfX&�(�-˓���qI՚�� 7�� l�%`P�Ɯ��s�5É��R95��ԭ�pr� h9��o����ʎ�ͥ1k�<��I,����hA%lm]��I�e4_V��ۚ�ɛq�Y)g���c��P�\�ɥK�ʝus������q�[r�z7��QSM�[�AzOMѼ qz̲m0e�mk�M<6`4`�ua��4��,��F��Z�W�4gs��A�1�+�����`�S�zoP�4 �K� ��ok�T~3�]�xЍF�c��Ո:ZQ[e��6_�z���p8���'��С��x�@�P��5 x�~�u5ˠe�C�(�� �ia�Q��q�˰'�����j5xf$˘@��I��i`h�Ц�c�=��V�N'���X�U��Qm4g �)< ���%��sm ��0��mhK4��$��[4y �Z��h�T������a+��Z}[2Ù=�:�ݮ�Ŏ�,�Y��$�W@9J*��'���*��qI�u�W ���n<�d����ԞE�f�l���`�!��$iuIZS't����"^5P ������Ԇ����*8&��@��2��& �����^�����^�����aEj�B:TZ{��� �3q ��%6eb�Sm6 �\$h�nMR��Q�ko�m{�Is����Ե�ؚ�Xb��ON �q��Dy�L>�Pv-�eЗ��ޯ�f��'��+5�R��� �Īa��'Ж~BSH�뇶aukӻ�~�Ӿ:��D��b�����qȂ���$H�l�9ݣH(=�[�l��V�:��+ǎP?��wi/Rc�t1���V%�aa+Ǒ�;��Y+��]E�&�oBl��!�����P��u_��F�i B@�I�!�v՝��&����<0LH����w�1�����@W6���^X� Ʈ�ث���bȲ�sB���h�a7!�j���M���]�����J��5ޝ�F�� hh'��]����Ԛ��u��[�Y�[����� -a5�P��� n_��.�������4�"V]����4��.9�4f�*��f���D�}������n�G��̡Om�σPK �[ Controllers/Api/PK �[�/=O� � ! Controllers/Api/ApiController.phpuO�j�0��+�`�m\zM�6JϽ�=lm%UqVB������P���J;���ã�t���a�a�\�*��gK�m�h��ޙ�R-�COd:3mA���aZ�_�<�'���R%��j�!�%֣ �z<z�?��(x�H*[�=�7t�$4e<M���z���ݪ���hLǘ��io[8��ax߯���"����F��,��v_l)=\���%lwC�bN��~�% &�6��.�PK �[���9 v "