Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/Coupon.tar
Назад
lang/.gitkeep 0000644 00000000000 15012233327 0007102 0 ustar 00 module.json 0000644 00000000332 15012233327 0006720 0 ustar 00 { "name": "Coupon", "alias": "coupon", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\Coupon\\app\\Providers\\CouponServiceProvider" ], "files": [] } tests/Unit/.gitkeep 0000644 00000000000 15012233327 0010242 0 ustar 00 tests/Feature/.gitkeep 0000644 00000000000 15012233327 0010716 0 ustar 00 vite.config.js 0000644 00000001302 15012233327 0007307 0 ustar 00 import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ build: { outDir: '../../public/build-coupon', emptyOutDir: true, manifest: true, }, plugins: [ laravel({ publicDirectory: '../../public', buildDirectory: 'build-coupon', input: [ __dirname + '/resources/assets/sass/app.scss', __dirname + '/resources/assets/js/app.js' ], refresh: true, }), ], }); //export const paths = [ // 'Modules/$STUDLY_NAME$/resources/assets/sass/app.scss', // 'Modules/$STUDLY_NAME$/resources/assets/js/app.js', //]; wsus.json 0000644 00000000617 15012233327 0006442 0 ustar 00 { "name": "Coupon Addon", "is_default": true, "description": "This is Coupon Addon", "author": { "name": "Websolutionsus", "email": "websolutionus1@gmail.com", "website": "https://websolutionus.com" }, "license": "Proprietary", "url": "", "options" : { "route" : "home" }, "last_update": "2024-03-31", "version": "1.0.0" } routes/.gitkeep 0000644 00000000000 15012233327 0007502 0 ustar 00 routes/error_log 0000644 00000000436 15012233327 0010003 0 ustar 00 [07-May-2025 19:33:18 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\Route" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/routes/api.php:5 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/routes/api.php on line 5 routes/web.php 0000644 00000001011 15012233327 0007342 0 ustar 00 <?php use Illuminate\Support\Facades\Route; use Modules\Coupon\app\Http\Controllers\CouponController; Route::group(['as' => 'admin.', 'prefix' => 'admin', 'middleware' => ['auth:admin', 'translation']], function () { Route::resource('coupon', CouponController::class)->names('coupon'); Route::put('/coupon/status-update/{id}', [CouponController::class, 'statusUpdate'])->name('coupon.status-update'); Route::get('coupon-history', [CouponController::class, 'coupon_history'])->name('coupon-history'); }); routes/api.php 0000644 00000000215 15012233327 0007343 0 ustar 00 <?php use Illuminate\Support\Facades\Route; Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () { }); composer.json 0000644 00000001267 15012233327 0007272 0 ustar 00 { "name": "nwidart/coupon", "description": "", "authors": [ { "name": "Nicolas Widart", "email": "n.widart@gmail.com" } ], "extra": { "laravel": { "providers": [], "aliases": { } } }, "autoload": { "psr-4": { "Modules\\Coupon\\": "", "Modules\\Coupon\\App\\": "app/", "Modules\\Coupon\\Database\\Factories\\": "database/factories/", "Modules\\Coupon\\Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Modules\\Coupon\\Tests\\": "tests/" } } } config/config.php 0000644 00000000053 15012233327 0007763 0 ustar 00 <?php return [ 'name' => 'Coupon', ]; config/.gitkeep 0000644 00000000000 15012233327 0007426 0 ustar 00 package.json 0000644 00000000410 15012233327 0007023 0 ustar 00 { "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.5", "sass": "^1.69.5", "postcss": "^8.3.7", "vite": "^4.0.0" } } app/Http/Controllers/CouponController.php 0000644 00000007470 15012233327 0014577 0 ustar 00 <?php namespace Modules\Coupon\app\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Modules\Coupon\app\Models\Coupon; use Modules\Coupon\app\Models\CouponHistory; class CouponController extends Controller { public function index() { $coupons = Coupon::where(['author_id' => 0])->latest()->get(); return view('coupon::index', compact('coupons')); } public function store(Request $request) { $rules = [ 'coupon_code' => 'required|unique:coupons', 'offer_percentage' => 'required|numeric', 'min_price' => 'required|numeric', 'expired_date' => 'required', ]; $customMessages = [ 'coupon_code.required' => __('Coupon code is required'), 'coupon_code.unique' => __('Coupon already exist'), 'offer_percentage.required' => __('Offer percentage is required'), 'expired_date.required' => __('Expired date is required'), 'min_price.required' => __('Minimum price is required'), ]; $this->validate($request, $rules, $customMessages); $coupon = new Coupon(); $coupon->author_id = 0; $coupon->coupon_code = $request->coupon_code; $coupon->offer_percentage = $request->offer_percentage; $coupon->min_price = $request->min_price; $coupon->expired_date = $request->expired_date; $coupon->status = $request->status; $coupon->save(); $notification = __('Created Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function update(Request $request, $id) { $rules = [ 'coupon_code' => 'required|unique:coupons,coupon_code,'.$id, 'offer_percentage' => 'required|numeric', 'min_price' => 'required|numeric', 'expired_date' => 'required', ]; $customMessages = [ 'coupon_code.required' => __('Coupon code is required'), 'coupon_code.unique' => __('Coupon already exist'), 'offer_percentage.required' => __('Offer percentage is required'), 'expired_date.required' => __('Expired date is required'), 'min_price.required' => __('Minimum price is required'), ]; $this->validate($request, $rules, $customMessages); $coupon = Coupon::find($id); $coupon->coupon_code = $request->coupon_code; $coupon->offer_percentage = $request->offer_percentage; $coupon->min_price = $request->min_price; $coupon->expired_date = $request->expired_date; $coupon->status = $request->status; $coupon->save(); $notification = __('Updated Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function destroy($id) { $coupon = Coupon::find($id); $coupon->delete(); $notification = __('Deleted Successfully'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect()->back()->with($notification); } public function coupon_history() { $coupon_histories = CouponHistory::where(['author_id' => 0])->latest()->get(); return view('coupon::history', ['coupon_histories' => $coupon_histories]); } public function statusUpdate($id) { $coupon = Coupon::find($id); $status = $coupon->status == 'active' ? 'inactive' : 'active'; $coupon->update(['status' => $status]); $notification = __('Updated Successfully'); return response()->json([ 'success' => true, 'message' => $notification, ]); } } app/Http/Controllers/.gitkeep 0000644 00000000000 15012233327 0012166 0 ustar 00 app/Http/Controllers/error_log 0000644 00000000525 15012233327 0012466 0 ustar 00 [10-May-2025 16:13:24 UTC] PHP Fatal error: Uncaught Error: Class "App\Http\Controllers\Controller" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Http/Controllers/CouponController.php:10 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Http/Controllers/CouponController.php on line 10 app/Http/Requests/.gitkeep 0000644 00000000000 15012233327 0011473 0 ustar 00 app/Http/Middleware/.gitkeep 0000644 00000000000 15012233327 0011735 0 ustar 00 app/Models/CouponHistory.php 0000644 00000000736 15012233327 0012111 0 ustar 00 <?php namespace Modules\Coupon\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Modules\Coupon\Database\factories\CouponHistoryFactory; class CouponHistory extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = []; protected static function newFactory(): CouponHistoryFactory { //return CouponHistoryFactory::new(); } } app/Models/.gitkeep 0000644 00000000000 15012233327 0010164 0 ustar 00 app/Models/Coupon.php 0000644 00000000450 15012233327 0010520 0 ustar 00 <?php namespace Modules\Coupon\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Coupon extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = ['status']; } app/Models/error_log 0000644 00000001152 15012233327 0010461 0 ustar 00 [10-May-2025 15:03:22 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Models/Coupon.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Models/Coupon.php on line 8 [10-May-2025 15:06:37 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Eloquent\Model" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Models/CouponHistory.php:9 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Models/CouponHistory.php on line 9 app/Providers/RouteServiceProvider.php 0000644 00000002657 15012233327 0014154 0 ustar 00 <?php namespace Modules\Coupon\app\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { /** * The module namespace to assume when generating URLs to actions. */ protected string $moduleNamespace = 'Modules\Coupon\app\Http\Controllers'; /** * Called before routes are registered. * * Register any model bindings or pattern based filters. */ public function boot(): void { parent::boot(); } /** * Define the routes for the application. */ public function map(): void { $this->mapApiRoutes(); $this->mapWebRoutes(); } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. */ protected function mapWebRoutes(): void { Route::middleware('web') ->namespace($this->moduleNamespace) ->group(module_path('Coupon', '/routes/web.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. */ protected function mapApiRoutes(): void { Route::prefix('api') ->middleware('api') ->namespace($this->moduleNamespace) ->group(module_path('Coupon', '/routes/api.php')); } } app/Providers/.gitkeep 0000644 00000000000 15012233327 0010716 0 ustar 00 app/Providers/CouponServiceProvider.php 0000644 00000006436 15012233327 0014320 0 ustar 00 <?php namespace Modules\Coupon\app\Providers; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; class CouponServiceProvider extends ServiceProvider { protected string $moduleName = 'Coupon'; protected string $moduleNameLower = 'coupon'; /** * Boot the application events. */ public function boot(): void { $this->registerCommands(); $this->registerCommandSchedules(); $this->registerTranslations(); $this->registerConfig(); $this->registerViews(); $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); } /** * Register the service provider. */ public function register(): void { $this->app->register(RouteServiceProvider::class); } /** * Register commands in the format of Command::class */ protected function registerCommands(): void { // $this->commands([]); } /** * Register command Schedules. */ protected function registerCommandSchedules(): void { // $this->app->booted(function () { // $schedule = $this->app->make(Schedule::class); // $schedule->command('inspire')->hourly(); // }); } /** * Register translations. */ public function registerTranslations(): void { $langPath = resource_path('lang/modules/'.$this->moduleNameLower); if (is_dir($langPath)) { $this->loadTranslationsFrom($langPath, $this->moduleNameLower); $this->loadJsonTranslationsFrom($langPath); } else { $this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower); $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang')); } } /** * Register config. */ protected function registerConfig(): void { $this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config'); $this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower); } /** * Register views. */ public function registerViews(): void { $viewPath = resource_path('views/modules/'.$this->moduleNameLower); $sourcePath = module_path($this->moduleName, 'resources/views'); $this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']); $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); $componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.config('modules.paths.generator.component-class.path')); Blade::componentNamespace($componentNamespace, $this->moduleNameLower); } /** * Get the services provided by the provider. */ public function provides(): array { return []; } private function getPublishableViewPaths(): array { $paths = []; foreach (config('view.paths') as $path) { if (is_dir($path.'/modules/'.$this->moduleNameLower)) { $paths[] = $path.'/modules/'.$this->moduleNameLower; } } return $paths; } } app/Providers/error_log 0000644 00000001274 15012233327 0011220 0 ustar 00 [10-May-2025 14:21:13 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Foundation\Support\Providers\RouteServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Providers/RouteServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Providers/RouteServiceProvider.php on line 8 [10-May-2025 15:30:32 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Support\ServiceProvider" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Providers/CouponServiceProvider.php:8 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/app/Providers/CouponServiceProvider.php on line 8 database/factories/.gitkeep 0000644 00000000000 15012233327 0011704 0 ustar 00 database/migrations/2023_11_29_095126_create_coupons_table.php 0000644 00000001446 15012233327 0017467 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('coupons', function (Blueprint $table) { $table->id(); $table->integer('author_id')->default(0); $table->string('coupon_code'); $table->decimal('offer_percentage', 8, 2); $table->string('expired_date'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('coupons'); } }; database/migrations/2023_11_29_105234_create_coupon_histories_table.php 0000644 00000001432 15012233327 0021360 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('coupon_histories', function (Blueprint $table) { $table->id(); $table->integer('author_id')->default(0); $table->integer('user_id')->default(0); $table->string('coupon_code'); $table->integer('coupon_id'); $table->decimal('discount_amount', 8, 2); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('coupon_histories'); } }; database/migrations/.gitkeep 0000644 00000000000 15012233327 0012101 0 ustar 00 database/migrations/2023_11_29_113632_add_min_price_to_coupon.php 0000644 00000001125 15012233327 0020134 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::table('coupons', function (Blueprint $table) { $table->decimal('min_price', 8, 2); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('coupons', function (Blueprint $table) { $table->dropColumn('min_price'); }); } }; database/migrations/error_log 0000644 00000001436 15012233327 0012403 0 ustar 00 [12-May-2025 15:32:50 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/database/migrations/2023_11_29_105234_create_coupon_histories_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/database/migrations/2023_11_29_105234_create_coupon_histories_table.php on line 7 [13-May-2025 18:38:39 UTC] PHP Fatal error: Uncaught Error: Class "Illuminate\Database\Migrations\Migration" not found in /home/lekhnath/silverray.com.au/Modules/Coupon/database/migrations/2023_11_29_095126_create_coupons_table.php:7 Stack trace: #0 {main} thrown in /home/lekhnath/silverray.com.au/Modules/Coupon/database/migrations/2023_11_29_095126_create_coupons_table.php on line 7 database/seeders/.gitkeep 0000644 00000000000 15012233327 0011357 0 ustar 00 database/seeders/CouponDatabaseSeeder.php 0000644 00000000371 15012233327 0014472 0 ustar 00 <?php namespace Modules\Coupon\database\seeders; use Illuminate\Database\Seeder; class CouponDatabaseSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { // $this->call([]); } } resources/assets/.gitkeep 0000644 00000000000 15012233327 0011475 0 ustar 00 resources/assets/js/app.js 0000644 00000000000 15012233327 0011576 0 ustar 00 resources/assets/sass/app.scss 0000644 00000000000 15012233327 0012472 0 ustar 00 resources/views/sidebar.blade.php 0000644 00000001204 15012233327 0013076 0 ustar 00 <li class="nav-item dropdown {{ isRoute(['admin.coupon.index', 'admin.coupon-history'], 'active') }}"> <a href="#" class="nav-link has-dropdown" data-toggle="dropdown"><i class="fas fa-money-bill-wave"></i> <span>{{ __('Manage Coupon') }} </span> </a> <ul class="dropdown-menu"> <li class="{{ isRoute('admin.coupon.index', 'active') }}"><a class="nav-link" href="{{ route('admin.coupon.index') }}">{{ __('Coupon List') }}</a></li> <li class="{{ isRoute('admin.coupon-history', 'active') }}"><a class="nav-link" href="{{ route('admin.coupon-history') }}">{{ __('Coupon History') }}</a></li> </ul> </li> resources/views/.gitkeep 0000644 00000000000 15012233327 0011330 0 ustar 00 resources/views/history.blade.php 0000644 00000005300 15012233327 0013167 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Coupon Histories') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Coupon Histories') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Coupon Histories') => '#', ]" /> <div class="section-body"> <div class="row mt-sm-4"> <div class="col-12"> <div class="card "> <div class="card-body"> <div class="table-responsive table-invoice"> <table class="table table-striped"> <thead> <tr> <th>{{ __('SN') }}</th> <th>{{ __('Coupon Code') }}</th> <th>{{ __('Discount Amount') }}</th> <th>{{ __('Date') }}</th> </tr> </thead> <tbody> @forelse ($coupon_histories as $index => $coupon_history) <tr> <td>{{ ++$index }}</td> <td>{{ $coupon_history->coupon_code }}</td> <td> {{ currency($coupon_history->discount_amount) }} </td> <td>{{ formattedDateTime($coupon_history->created_at) }} </td> </tr> @empty <x-empty-table :name="__('Coupon')" route="admin.coupon.index" create="no" :message="__('No data found!')" colspan="7"></x-empty-table> @endforelse </tbody> </table> </div> </div> </div> </div> </div> </div> </section> </div> @endsection resources/views/index.blade.php 0000644 00000025420 15012233327 0012602 0 ustar 00 @extends('admin.master_layout') @section('title') <title>{{ __('Coupon List') }}</title> @endsection @section('admin-content') <div class="main-content"> <section class="section"> <x-admin.breadcrumb title="{{ __('Coupon List') }}" :list="[ __('Dashboard') => route('admin.dashboard'), __('Coupon List') => '#', ]" /> <div class="section-body"> <div class="row mt-sm-4"> <div class="col-12"> <div class="card "> <div class="card-header d-flex justify-content-between"> <x-admin.form-title :text="__('Coupon List')" /> <div> <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#create_coupon_id" class="btn btn-primary"><i class="fas fa-plus"></i> {{ __('Add New') }}</a> </div> </div> <div class="card-body"> <div class="table-responsive table-invoice"> <table class="table table-striped"> <thead> <tr> <th>{{ __('SN') }}</th> <th>{{ __('Coupon Code') }}</th> <th>{{ __('Min Price') }}</th> <th>{{ __('Offer') }}</th> <th>{{ __('End time') }}</th> <th>{{ __('Status') }}</th> <th>{{ __('Action') }}</th> </tr> </thead> <tbody> @forelse ($coupons as $index => $coupon) <tr> <td>{{ ++$index }}</td> <td>{{ $coupon->coupon_code }}</td> <td>{{ currency($coupon->min_price) }}</td> <td>{{ $coupon->offer_percentage }}%</td> <td>{{ formattedDate($coupon->expired_date) }}</td> <td> <input onchange="changeStatus({{ $coupon->id }})" id="status_toggle" type="checkbox" {{ $coupon->status == 'active' ? 'checked' : '' }} data-toggle="toggle" data-onlabel="{{ __('Active') }}" data-offlabel="{{ __('Inactive') }}" data-onstyle="success" data-offstyle="danger"> </td> <td> <a href="javascript:;" data-bs-toggle="modal" data-bs-target="#edit_coupon_id_{{ $coupon->id }}" class="btn btn-warning btn-sm"><i class="fa fa-edit" aria-hidden="true"></i></a> <x-admin.delete-button :id="$coupon->id" onclick="deleteData" /> </td> </tr> @empty <x-empty-table :name="__('Coupon')" route="" create="no" :message="__('No data found!')" colspan="7"></x-empty-table> @endforelse </tbody> </table> </div> </div> </div> </div> </div> </div> </section> </div> @foreach ($coupons as $index => $coupon) <div class="modal fade" id="edit_coupon_id_{{ $coupon->id }}" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Create Coupon') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <div class="container-fluid"> <form action="{{ route('admin.coupon.update', $coupon->id) }}" method="POST"> @csrf @method('PUT') <div class="form-group"> <x-admin.form-input name="coupon_code" label="{{ __('Coupon Code') }}" placeholder="{{ __('Enter Coupon Code') }}" value="{{ $coupon->coupon_code }}" required="true"/> </div> <div class="form-group"> <x-admin.form-input type="number" name="min_price" label="{{ __('Minimum purchase price') }}" placeholder="{{ __('Enter Minimum purchase price') }}" value="{{ $coupon->min_price }}" required="true"/> </div> <div class="form-group"> <x-admin.form-input name="offer_percentage" label="{{ __('Offer') }}(%)" placeholder="{{ __('Enter Offer Percentage') }}" value="{{ $coupon->offer_percentage }}" required="true"/> </div> <div class="form-group"> <x-admin.form-input class="datepicker" name="expired_date" label="{{ __('End time') }}" placeholder="{{ __('Enter End time') }}" value="{{ $coupon->expired_date }}" required="true"/> </div> <div class="form-group"> <x-admin.form-switch name="status" label="{{ __('Status') }}" active_value="active" inactive_value="inactive" :checked="$coupon->status == 'active'"/> </div> </div> </div> <div class="modal-footer"> <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{__('Close')}}"/> <x-admin.button type="submit" text="{{__('Update')}}"/> </div> </form> </div> </div> </div> @endforeach <!-- Modal --> <div class="modal fade" id="create_coupon_id" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ __('Create Coupon') }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <div class="container-fluid"> <form action="{{ route('admin.coupon.store') }}" method="POST"> @csrf <div class="form-group"> <x-admin.form-input id="create_coupon_code" name="coupon_code" label="{{ __('Coupon Code') }}" placeholder="{{ __('Enter Coupon Code') }}" required="true"/> </div> <div class="form-group"> <x-admin.form-input type="number" name="min_price" label="{{ __('Minimum purchase price') }}" placeholder="{{ __('Enter Minimum purchase price') }}" required="true"/> </div> <div class="form-group"> <x-admin.form-input name="offer_percentage" label="{{ __('Offer') }}(%)" placeholder="{{ __('Enter Offer Percentage') }}" required="true"/> </div> <div class="form-group"> <x-admin.form-input class="datepicker" name="expired_date" label="{{ __('End time') }}" placeholder="{{ __('Enter End time') }}" required="true"/> </div> <div class="form-group"> <x-admin.form-switch name="status" label="{{ __('Status') }}" active_value="active" inactive_value="inactive" :checked="old('status') == 'active'"/> </div> </div> </div> <div class="modal-footer"> <x-admin.button variant="danger" data-bs-dismiss="modal" text="{{__('Close')}}"/> <x-admin.button type="submit" text="{{__('Save')}}"/> </div> </form> </div> </div> </div> <x-admin.delete-modal /> <script> "use strict" function deleteData(id) { $("#deleteForm").attr("action", '{{ url('admin/coupon/') }}' + "/" + id) } "use strict" function changeStatus(id) { var isDemo = "{{ env('APP_MODE') ?? 'LIVE' }}"; if (isDemo == 'DEMO') { toastr.error("{{ __('This Is Demo Version. You Can Not Change Anything') }}"); return; } $.ajax({ type: "put", data: { _token: '{{ csrf_token() }}', }, url: "{{ url('/admin/coupon/status-update') }}" + "/" + id, success: function(response) { if (response.success) { toastr.success(response.message); } else { toastr.warning(response.message); } }, error: function(err) { handleFetchError(err); } }); } </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка