Category : laravel-7

i have 5 filter , kampus,fakulti,program ,semester and status so each filter is always been filter with status it means the status filter will be the selection of switch case and the other filter will be condition in the switch case example : if($student){ $today = date("Y-m-d"); switch($request->stat){ case ‘Y’: if($request->kampus != "-" && $request->fakulti ..

Read more

I’m trying to validate fields in my form and using unique rule $validator = Validator::make($request->all(),[ ’email’ => [‘required’, ‘string’, ’email’, ‘max:255’, Rule::unique(‘users’)->where(function ($q) { $q->whereNotNull(‘password’); }) ], ‘password’ => [‘required’, ‘string’, ‘min:5’, ‘confirmed’,’min:8′], ‘password_confirmation’ => [‘min:8’] ]); getting this error : message: "Call to undefined method IlluminateContractsValidationRule::unique()", used this namespace : use IlluminateContractsValidationRule; Any suggestion ..

Read more

I am relatively new to Laravel and Livewire. I am trying to make a custom registration form to register a new user. By custom I mean, I did not use Laravel’s registration. I implemented it by doing create operation. It works on my local machine but it is not working on the production server. If ..

Read more

well i’ve made fully dynamic routes on laravel for friendly url’s reasons, something like this: Route::get(‘/{first}/{second?}/{third?}/{fourth?}/{fifth?}/{sixth?}/{seventh?}’,’[email protected]’); so, the user can access any tree data level from scratch. My problem is when some page has a link to any file on my system, like: mysite.com/storage/app/archives/9b1fe45fdf5db9203341b73931a9308a.pdf that is matching on the route with my dynamic routing, and ..

Read more

Hi i calculated a discount in my controller by requesting in a form the percentage and the sale_price, so i did this: public function store(Request $request){ dd($request->all()); $presupuestoProducto = new PresupuestoProducto(); $presupuestoProducto->sale_price = $request->sale_price; $presupuestoProducto->discount_percentage = $request->discount_percentage; $presupuestoProducto->discount = ($sale_price * $discount_percentage)/100; $presupuestoProducto->save(); Session::flash(‘success’); return redirect()->route(‘presupuestos-productos.view’); } But now i want to make the result ..

Read more

Hi im trying to make a field in my view which is dicount (amount) to be auto calculated by doing the following: discount_amount=(sale_price * discount_percentage)/100 create_presupuestos_productos_table: public function up() { Schema::create(‘presupuestos_productos’, function (Blueprint $table) { $table->id(); $table->unsignedBigInteger(‘presupuesto_id’); $table->foreign(‘presupuesto_id’)->references(‘id’)->on(‘presupuestos’); $table->unsignedBigInteger(‘product_id’); $table->foreign(‘product_id’)->references(‘id’)->on(‘products’); $table->integer(‘quantity’); $table->decimal(‘sale_price’); $table->text(‘sale_coin’); $table->integer(‘discount_percentage’); $table->decimal(‘discount’); $table->decimal(‘AlicuotaIVA’); $table->text(‘commentary’); $table->timestamps(); }); This is the logic of my ..

Read more

Before I put some else condition codes, my controller was like this : And when I tried to login with this codes, it actually worked. function login(Request $request) { $validate_admin = User::where(’email’, $request->input(’email’)) ->first(); if($validate_admin) { if(Hash::check($request->input(‘password’), $validate_admin->password)){ if($validate_admin->email_verified == "yes") { Auth::loginUsingId($validate_admin->id); $request->session()->put(‘id’, $validate_admin->id); $validate_admin->last_login = now(); $validate_admin->save(); if($validate_admin->account_status == ‘1’ && $validate_admin->email_verified == ..

Read more

I try to add an .ics file to some of my emails, but on mailtrap I don’t get the attachment, I get only the content.. Not sure if I’m doing something wrong. public function toMail($notifiable) { $subject = some data..; $content = some data..; $filename = "invite.ics"; $data[0] = "BEGIN:VCALENDAR"; $data[1] = "PRODID:-//Google Inc//Google Calendar ..

Read more

I used composer to install mpdf composer require carlos-meneses/laravel-mpdf did all the settings in config/app.php file. The webfonts TTF files copied to resources/fonts/ folder. Added this to your configuration file (/config/pdf.php): <?php return [ ‘custom_font_dir’ => base_path(‘resources/fonts/’), // don’t forget the trailing slash! ‘custom_font_data’ => [ ‘examplefont’ => [ ‘R’ => ‘fa-regular-400.ttf’, // regular font ..

Read more

The amount I’m passing seems correct, but I got always an error. As I checkout the amount is invalid, even if I’m passing a float, and this error is shown on the page after submit: The payment function public function payment(Request $request) { $data = $request->all(); // dd($data[‘price’]); $gateway = new BraintreeGateway([ ‘environment’ => config(‘services.braintree.environment’), ..

Read more