mDelshad

mDelshad

Member Since 1 Year Ago

Experience Points
4,780
Total
Experience

220 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
4,780 XP
May
23
4 months ago
Activity icon

Replied to Create Foreign Key

@HPOLTHOF - so if i set innoDB for Tables that not need foreign key there is no problem

Activity icon

Started a new conversation Create Foreign Key

According to mysql documentation MyISAM engine does not support foreign key And you need to use innoDB engine. Now if I use the innoDB engine for all the tables, then there's no problem? For example, for a table of articles, news, etc.,

And what is the difference between innoDB and MyISAM in general?

Activity icon

Replied to Migration Problem: Cannot Add Foreign Key Constraint In Laravel

@TRAY2 - @msovani

users :

http://s8.picofile.com/file/8361391942/Screenshot_2019_05_23_127_0_0_1_MySQL_crypter_phpMyAdmin_4_8_4_1_.png

and gateway :

http://s8.picofile.com/file/8361391984/Screenshot_2019_05_23_127_0_0_1_MySQL_crypter_phpMyAdmin_4_8_4.png
May
22
4 months ago
Activity icon

Replied to Migration Problem: Cannot Add Foreign Key Constraint In Laravel

@TRAY2 - I changed it, but again gets error

Activity icon

Started a new conversation Migration Problem: Cannot Add Foreign Key Constraint In Laravel

i'm install a package And I want to make changes to the package migration

I'm trying to create foreign keys however when I migrate package table using artisan i am thrown the following error:

    Illuminate\Database\QueryException:

    SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table gateway_transactions add constraint gateway_transactions_user_id_foreign foreign key (user_id) references users (id) on delete CASCADE)

package migration :

        Schema::create($this->getTable(), function (Blueprint $table) {
           // $table->engine = "innoDB";
            $table->unsignedBigInteger('id', true);
            $table->unsignedInteger('user_id');
        $table->foreign('user_id')->references('id')->on('users');
            $table->enum('provider', \Parsisolution\Gateway\GatewayManager::availableDrivers());
            $table->decimal('amount', 15, 2);
            $table->integer('order_id')->nullable();
            $table->string('currency', 3)->nullable();
            $table->string('ref_id', 100)->nullable();
            $table->string('tracking_code', 50)->nullable();
            $table->string('card_number', 50)->nullable();
            $table->enum('status', \Parsisolution\Gateway\Transaction::availableStates())
                ->default(\Parsisolution\Gateway\Transaction::STATE_INIT);
            $table->string('ip', 20)->nullable();
            $table->json('extra')->nullable();
            $table->timestamp('paid_at')->nullable();
            $table->nullableTimestamps();
            $table->softDeletes();
        });

and users migration :

    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->uuid('uuid');
            $table->string('first_name')->nullable();
            $table->string('last_name')->nullable();
            $table->string('email')->unique();
            $table->string('avatar_type')->default('gravatar');
            $table->string('avatar_location')->nullable();
            $table->string('password')->nullable();
            $table->timestamp('password_changed_at')->nullable();
            $table->tinyInteger('active')->default(1)->unsigned();
            $table->string('confirmation_code')->nullable();
            $table->boolean('confirmed')->default(config('access.users.confirm_email') ? false : true);
            $table->string('timezone')->nullable();
            $table->text('National_Code')->nullable();
            $table->char('phone_number', 11)->nullable()->unique();  
            $table->integer('phone_verify')->default(0);
            $table->char('mobile_number', 11)->nullable()->unique();  
            $table->integer('mobile_verify')->default(0);
            $table->text('state')->nullable();
            $table->text('city')->nullable();
            $table->text('address')->nullable();
            $table->text('path')->nullable();
            $table->char('postal_code', 10)->nullable();
            $table->timestamp('last_login_at')->nullable();
            $table->string('last_login_ip')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }
May
08
5 months ago
Activity icon

Started a new conversation Problem With AJAX Post Request

I have a select box and when each item is selected, a ajax request is sent. but my code does not work. i'm get status 404 and this error is displayed in the console

exception: "Symfony\Component\HttpKernel\Exception\NotFoundHttpException", file: "F:\source\boiler\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php", line: 179, … 

my route:

Route::group(['namespace' => 'BuyCrypto' , 'prefix' => 'crypto'], function() {
          Route::post('/calculateBuyAmount' , [BuyCryptoController::class , 'calculateAmount'])->name('calculate.amount');
        });

and ajax code

$("select#user_select_crypto").change(function(e) {

    $('#calculat_user_buy').block({
        message: '<i class="icon-spinner4 spinner"></i>',

        overlayCSS: {
            backgroundColor: '#fff',
            opacity: 0.8,
            cursor: 'wait'
        },
        css: {
            border: 0,
            padding: 0,
            backgroundColor: 'transparent'
        }
    });

    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    e.preventDefault();
    $.ajax({
        url: "panel/crypto/calculateBuyAmount",
        dataType: 'json',
        data: {

            user_select_crypto: $("input[name=user_select_crypto]").val(),
            user_value_request: $("input[name=user_value_request]").val(),
        },
        success: function(result) {

            console.log(result)
        },
        error: function(result) {

            console.log(result)

        },
    });
});

what is problem?

May
03
5 months ago
Activity icon

Replied to Enable Inputs And Add Required Attribute

@BOBBYBOUWMANN - thanks, I've seen this, but the code that was has not worked

i right this for jquery but again not worked! what is problem?

  jQuery(function () {
    jQuery('#sell_status').change(function () {
        if (jQuery(this).val() !== '0') {
            $("#min_sell").prop('disabled', false);
        } else {
            $("#min_sell").prop('disabled', true);
        }
    });
});
Activity icon

Started a new conversation Enable Inputs And Add Required Attribute

hi

i have a select box that have two item (enable , disable) and three input

i want when the user select enable, each input be enabled and add Required Attribute to them.

And vice versa if select disable, each input be disabled and remove Required Attribute from them

can you help me

Apr
09
6 months ago
Activity icon

Started a new conversation Laravel Seeder Array To String Conversion

my migration :

        Schema::create('money', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('slug');
            $table->json('details');
            $table->timestamps();
        });

and seeder

        Money::create([
            'name' => 'pay',
            'slug' => 'PayPal',
            'details' => ([
                'status' => true,
                'sell' => [
                    'status' => true,
                    'sellesPrice' => '12300',
                ],
                'buy'=>[
                    'status'=> true,
                    'PurchasePrice'=>'11265',
                ],
            ])
        ]);
    }

but i get this error :

   Illuminate\Database\QueryException  : Array to string conversion (SQL: insert into `money` (`name`, `slug`, `details`, `updated_at`, `created_at`) values (پی پال, PayPal, 1, 2019-04-09 16:00:26, 2019-04-09 16:00:26))

  at M:\source\boiler\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   ErrorException::("Array to string conversion")
      M:\source\boiler\vendor\laravel\framework\src\Illuminate\Database\MySqlConnection.php:80

  2   PDOStatement::bindValue([])
      M:\source\boiler\vendor\laravel\framework\src\Illuminate\Database\MySqlConnection.php:80

  Please use the argument -v to see more details.

what is problem?

Apr
08
6 months ago
Activity icon

Started a new conversation Get Data From Xml Api

hi guys

i want get the currency rate from this api :

http://parsijoo.ir/api?serviceType=price-API&query=Currency

but this is xml api and I do not know how can i get data... i was convert this xml to json, With this code :

$response = file_get_contents('http://parsijoo.ir/api?serviceType=price-API&query=Currency');       
    $xml = simplexml_load_string($response);
    $json = json_encode($xml);
    $array = json_decode($json,TRUE);

But returns (name, price, change, percent ) values empty what is problem?

Apr
07
6 months ago
Activity icon

Started a new conversation Storing Order Information In Table

I have these services on the site

Buy PayPal - Perfect Money and ...
Registration of exam
GIF card services

How should the structure of the order table be? Because each service receives different information from the user, for example:

Registration of exam => receives (exam's price, time, exam's site and...) from user
and
buy paypal dollar=> receives (Amount requested ... PayPal email and ...) from user

how can storing this information on order's table??

Apr
05
6 months ago
Activity icon

Started a new conversation Create Custom Input For Each Product

i want the admin will be can create custom input for each product (optional) for example you want add a product And when the user orders that product, you also want to get some information from the user that is only needed for this product and not other products. so you can when create the this product, add a custom input for it that show to user in order form

I want to create this feature (as described in the screenshot below).

https://imgurl.ir/uploads/u175269_.png

Is this the right way? And if so, how can I put any row inside an array؟

Mar
29
6 months ago
Activity icon

Started a new conversation Many Error In Project

hi

i'm install this package for code analysis

https://github.com/nunomaduro/larastan

and when i run this command

php artisan code:analyse

it Found 203 errors

Most of the errors are the same


 ------ ---------------------------------------------------------------------------------------------------------------
  Line   app\Rules\Auth\UnusedPassword.php
 ------ ---------------------------------------------------------------------------------------------------------------
  19     PHPDoc tag @var has invalid value (): Unexpected token "\r\n     ", expected TOKEN_IDENTIFIER at offset 16
  27     PHPDoc tag @param has invalid value ($user): Unexpected token "$user", expected TOKEN_IDENTIFIER at offset 63
 ------ ---------------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------------
  Line   app\helpers.php
 ------ -----------------------------------------------------------------------------------------------------------------
  50     PHPDoc tag @param has invalid value ($folder): Unexpected token "$folder", expected TOKEN_IDENTIFIER at offset
         127
  53     Class RecursiveDirectoryIterator referenced with incorrect case: recursiveDirectoryIterator.
  54     Class RecursiveIteratorIterator referenced with incorrect case: recursiveIteratorIterator.
  57     Call to an undefined method RecursiveIteratorIterator::isDot().
  57     Call to an undefined method RecursiveIteratorIterator::isFile().
  57     Call to an undefined method RecursiveIteratorIterator::isReadable().
  99     PHPDoc tag @param has invalid value ($url): Unexpected token "$url", expected TOKEN_IDENTIFIER at offset 25
  114    PHPDoc tag @param has invalid value ($url): Unexpected token "$url", expected TOKEN_IDENTIFIER at offset 25
  129    PHPDoc tag @param has invalid value ($cancel_to): Unexpected token "$cancel_to", expected TOKEN_IDENTIFIER at
         offset 26
  129    PHPDoc tag @param has invalid value ($title): Unexpected token "$title", expected TOKEN_IDENTIFIER at offset 59
  143    PHPDoc tag @param has invalid value ($title): Unexpected token "$title", expected TOKEN_IDENTIFIER at offset 26
  156    PHPDoc tag @param has invalid value ($str): Unexpected token "$str", expected TOKEN_IDENTIFIER at offset 19
 ------ -----------------------------------------------------------------------------------------------------------------

 [ERROR] Found 203 errors

But at the time of run my project, I'm not getting any error and everything is correct

what is your opinion Can these errors make problems?

Mar
20
6 months ago
Activity icon

Started a new conversation Can't Update Config File

i can't update config file ... what is problem

  Config::set('gateways.zarinpal.merchat-id' ,'xxxxxxxxxxxx');
  'zarinpal'     => [
        'name'         => 'Zarinpal',
        'active'       => true,
        'order'        => 11,
        'merchant-id'  => xxx',
        'type'         => 'normal',             // Types: [zarin-gate || normal || zarin-gate-sad || zarin-gate-sep]
        'server'       => 'de',                // Servers: [germany || iran || test]
        'description'  => 'description',
        'callback-url' => '/',
    ],

There are no errors

Activity icon

Started a new conversation Is It Better To Store Platform Configuration In Database Or A File?

For settings like app name,company information, payment gateway key and....

what is better/faster approach?

Activity icon

Replied to Can't Use Helper Functions In Config File

@ftiersch @johnbaron I have a lot of data (Perhaps more than 20 items) to be recorded in the files in the config folder Now if I use AppServiceProvider this way

  config([
            'app.name' => getSetting('app_name'),
            'sms.drivers.kavenegar.apiKey' => getSetting('kavenegar_api'),
            'sms.drivers.kavenegar.from' => getSetting('number'),
            ]);

There are many queries that push the server If I read the cache, many more queries will not be executed and there will not be much pressure on the server. It is true? And in terms of the number of data I've said, perhaps more than 20, do you think this is a problem? Or there is no problem with the number of data

Mar
19
6 months ago
Activity icon

Started a new conversation Get Values With A Specified Prefix From The Table

Hello I have the general settings and payment gateway settings.

The settings are saved as their key:

general.setting_name  => general settings
gateway.setting_name => payment gateway settings

Now how can I get the only values ​​that have a general prefix?

Mar
18
6 months ago
Activity icon

Replied to Best Solution For App Settings

@TYKUS - I save the settings to the table in this way

    public function store(Request $request)
    {
        $data = $request->only('app_name','app_desc','company_phone','company_address','service_wage'
                ,'kavenegar_api'
                ,'kavenegar_number'
        );
        foreach ($data as $key => $value) {
            Setting::updateOrInsert(
                ['name' => $key],
                ['val' => $value]
            );
        }
        return redirect()->back()->withFlashSuccess("saved");
    }

now how can i cache in loop? That is correct?

Cache::forever('key', 'value');

and if cache cleared..how should get the settings from db and again store in the cache?

Activity icon

Started a new conversation Best Solution For App Settings

If I save the settings in the database, there are definitely a lot of requests to the database to get the settings and this will put a lot of pressure on the server. Now if I save these settings inside a file that will be placed in the Config folder, do you think it's the right way? And security? You do not have the right solution?

Activity icon

Started a new conversation Can't Use Helper Functions In Config File

hi

I can not use the helper settings in the config folder files

What is your solution to this problem?

Mar
15
7 months ago
Activity icon

Started a new conversation Problem In Use Switchery

i'm use switchery for checkbox...But only one of the checkboxes takes a stylist. The rest of the checkboxes have a typical style

screenshot:

https://screenshots.firefox.com/x3TSE0U1kd4AWgNg/127.0.0.1

js:

import Switchery from './switchery.min'


var elems = Array.prototype.slice.call(document.querySelectorAll('.switch-input'));

elems.forEach(function(html) {
  var switchery = new Switchery(html);
});

and blade :

                                        <td>
                                            @if($roles->count())
                                                @foreach($roles as $role)
                                                    <div class="card">
                                                        <div class="card-header">
                                                            <div class="checkbox d-flex align-items-center">
                                                                {{ html()->label(
                                                                        html()->checkbox('roles[]', in_array($role->name, $userRoles), $role->name)
                                                                                ->class('switch-input')
                                                                                ->id('role-'.$role->id)
                                                                        . '<span class="switch-slider" data-checked="on" data-unchecked="off"></span>')
                                                                    ->class('switch switch-label switch-pill switch-primary mr-2')
                                                                    ->for('role-'.$role->id) }}
                                                                {{ html()->label(ucwords($role->name))->for('role-'.$role->id) }}
                                                            </div>
                                                        </div>
                                                        <div class="card-body">
                                                            @if($role->id != 1)
                                                                @if($role->permissions->count())
                                                                    @foreach($role->permissions as $permission)
                                                                        <i class="fas fa-dot-circle"></i> {{ ucwords($permission->name) }}
                                                                    @endforeach
                                                                @else
                                                                    @lang('labels.general.none')
                                                                @endif
                                                            @else
                                                                @lang('labels.backend.access.users.all_permissions')
                                                            @endif
                                                        </div>
                                                    </div><!--card-->
                                                @endforeach
                                            @endif
                                        </td>
Activity icon

Replied to Add Html Tag In Lang File

@SNAPEY - How can i do this?

Activity icon

Replied to Add Html Tag In Lang File

@cronix @esmaill23

throw new GeneralException({!! __('exceptions.frontend.auth.confirmation.resend', ['url' => route('frontend.auth.account.confirm.resend', $user->{$user->getUuidName()})]!!}));

this error displayed :

syntax error, unexpected 'throw' (T_THROW)

and try this but not worked

 'resend' => 'Your account is not confirmed. Please click the confirmation link in your e-mail, or {!!<a href=":url">click here</a>!!} to resend the confirmation e-mail.',

Mar
14
7 months ago
Activity icon

Started a new conversation Add Html Tag In Lang File

hi

i'm write a html tag in a lang file

'resend' => 'Your account is not confirmed. Please click the confirmation link in your e-mail, or <a href=":url">click here</a> to resend the confirmation e-mail.',

But it does not display well on the output :

https://screenshots.firefox.com/WEQzcvKw2RXmBaIS/127.0.0.1
Mar
09
7 months ago
Activity icon

Started a new conversation Undefined Variable In Notification

i'm create a markdown notification, but when i want send a email this error displayed

Undefined variable: name (View: M:\source\boiler\resources\views\emails\backend\RejectDocument.blade.php)

notification class :

<?php

namespace App\Notifications\backend\auth;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class RejectDocument extends Notification
{
    use Queueable;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
     protected $description,$name;
    public function __construct($description , $name)
    {
        $this->description = $description;
        $this->name = $name;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
        ->with($this->description,$this->name)
        ->subject('Reject Docs')
        ->markdown('emails.backend.RejectDocument');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

blade file :

@component('mail::message')
hello {{$name}}
@component('mail::panel')
  {{$description}}
@endcomponent

Thanks,<br>
{{ config('app.name') }}
@endcomponent

and this for send:

  $user = App\Models\Auth\User::first();
    $user->notify(new RejectDocument("Your Document Rejected",$user->name));

Mar
08
7 months ago
Activity icon

Started a new conversation Change Email Template

Can you provide an email template for larvae? I wanted to change the template, but it had a lot of problems

Mar
06
7 months ago
Activity icon

Replied to Submit Form With Sweet Alert

@TANGENTE - Still has problem... this is html code

                <button type="button" id="verifyDoc" class="btn btn-success">تایید</button>
                <form action="{{route('admin.auth.document.update' , [$document->id])}}" id="verifyDocForm" method="post">
                                    {{ csrf_field() }}
                                    {{method_field('PATCH')}}
                  <input type="hidden" name="actionCode" value="1">
                </form>
Activity icon

Replied to Submit Form With Sweet Alert

@TANGENTE - If you mean this I tried it, but it has the it problem

jQuery(document).ready(function(){
    jQuery('button#verifyDoc').on('click', function(event ){
event.preventDefault();
      swal({
        title: "",
        text: "...",
        type: "info",
        showCancelButton: true,
            buttonsStyling: true,
        confirmButtonText: "ok",
        cancelButtonText: "cancel",
      }).then(function(isConfirm){
            if(isConfirm){
        jQuery("#verifyDocForm").submit();
            }
      });
    });
});
Activity icon

Started a new conversation Submit Form With Sweet Alert

What is the problem with this code I want to submit if user click on confirm But in this code, if user click Cancel or outside of the sweet alert, the form will still be submitted

jQuery(document).ready(function(){
    jQuery('button#verifyDoc').on('click', function(){
      swal({
        title: "",
        text: "...",
        type: "info",
        showCancelButton: true,
            buttonsStyling: true,
        confirmButtonText: "ok",
        cancelButtonText: "cancel",
      }).then(function(isConfirm){
            if(isConfirm){
        jQuery("#verifyDocForm").submit();
            }
      });
    });
});
Mar
04
7 months ago
Activity icon

Replied to Update User Information

@CRONIX - thank you I will certainly edit this

Activity icon

Started a new conversation Update User Information

this is controller for update user information

    public function update($id, array $input)
    {

        $user = $this->getById($id);
        $user->first_name = $input['first_name'];
        $user->last_name = $input['last_name'];
        $user->avatar_type = $input['avatar_type'];
        $user->National_Code = $input['National_Code'];
        $user->phone_number = $input['phone_number'];
        $user->mobile_number = $input['mobile_number'];
        $user->state = $input['state'];
        $user->city = $input['city'];
        $user->address = $input['address'];
        $user->postal_code = $input['postal_code'];

        if ($user->phone_number != $input['phone_number']) {
          $user->phone_verify  = 0;
        }

        if ($user->mobile_number != $input['mobile_number']) {
          $user->mobile_verify  = 0;
        }


        $user->save();
    }


In this code, if the previous number of the user is not equal to the new number, the value of mobile_verify must be 0 , All user information is updated, but this does not change the mobile_verify and phone_verify case

Activity icon

Started a new conversation Code Analysis

What happens in this code? , What exactly does it do?

preConfirm: function (email) {
                            return new Promise(function (resolve) {
                                setTimeout(function () {
                                    if (email === '[email protected]') {
                                        swal.showValidationError('This email is already taken.')
                                    }
                                    resolve();
                                }, 2000);
                            });
                        },
Mar
03
7 months ago
Activity icon

Replied to Ajax Request In Sweet Alert

@CRONIX - thanks bro, how can i get input value (in sweet alert)?

Activity icon

Started a new conversation Ajax Request In Sweet Alert

I show to user a sweet alert after sending the activation code...This sweet alert has an input that the user must enter received code and send in the ajax request, how i can do this?

swal({
                        title: 'enter confirmation code',
                        input: 'text',
                        inputPlaceholder: 'confirmation code',
                        showCancelButton: true,
                        inputClass: 'form-control',
                        inputValidator: function (value) {
                            return !value && 'You need to write something!'
                        }
                    }).then(function (result) {
                        if (result.value) {
                            swal({
                                type: 'success',
                                html: 'code, ' + result.value
                            });
                        }
                    });
Mar
02
7 months ago
Activity icon

Started a new conversation Get The Distance Between Two Times

I get the updated_atfield of record

And I want to check if beetween the current time and updated_at are more than 3 minutes apart, displaying the expiration message.

How can i do this?

Activity icon

Started a new conversation Create A Code With Expiration Time

i want add the mobile verification, How can i Create a code with expiration time?

Mar
01
7 months ago
Activity icon

Replied to Create Form Builder

@TRAY2 - Yes, that's exactly that

Activity icon

Replied to Create Form Builder

@MUNAZZIL - thank you But that was not what I meant I want admin can create different forms with ui (in admin panel), not with code

Activity icon

Started a new conversation Create Form Builder

how can create a form builder like wordpress form builder plugins?

Feb
28
7 months ago
Activity icon

Replied to Call To A Member Function Connection() On Null

@RDELORIER - Thanks,

You could update the config option in the boot method of AppServiceProvider tho.

How can i do this?

Activity icon

Replied to Call To A Member Function Connection() On Null

@MUNAZZIL - I ckecked it

Fatal error: Uncaught RuntimeException: A facade root has not been set. in M:\source\boiler\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:234 Stack trace: #0 M:\source\boiler\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(397): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array) #1 M:\source\boiler\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(374): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths() #2 M:\source\boiler\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(289): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException)) #3 M:\source\boiler\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(188): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpException)) #4 M:\source\boiler\app\Exceptions\Handl in M:\source\boiler\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 234
Activity icon

Replied to Call To A Member Function Connection() On Null

@REALRANDYALLEN -

 'name' => getSetting('app_name')

I think the problem is this code:

        return Setting::where('name',$setting)->first()->val;

Because I deleted this code and did not display any errors

Activity icon

Replied to Call To A Member Function Connection() On Null

@REALRANDYALLEN - I tested it, but it again show this error

Activity icon

Started a new conversation Call To A Member Function Connection() On Null

i'm create a helper to get settings

if (! function_exists('Setting')) {

    /**
     * @param $setting
     *
     * @return string
     */
    function Setting($setting)
    {
        return Setting::where('name',$setting)->first()->val;
    }


}

in config/app.php and Application name i'm set this code Setting('app_name')

but this error displayed

Call to a member function connection() on null
Activity icon

Started a new conversation SQLSTATE[23000]: Integrity Constraint Violation: 1062 Duplicate Entry

i'm store or update data with this code

public function store(Request $request)
    {
        $data = $request->only('app_name','app_desc');
        foreach ($data as $key => $value) {
            Setting::updateOrInsert(
                ['name' => $key, 'val' => $value],
            );
        }
    }

but this error displayed.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'app_name' for key 'settings_name_unique' (SQL: insert into `settings` (`name`, `val`) values (app_name, example site desc))

and migration :

 Schema::create('settings', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique();
            $table->text('val')->nullable();
            $table->timestamps();
        });
Activity icon

Replied to Storing Data With Loops

@SERGIU17 - the table just have two field

key => input name,
value => input value

Is this code correct?


$data = $request->all();
foreach ($data as $key => $value) {
    model::create([
        'key' => $key;
         'value' =>$value
    ]);
}
Activity icon

Started a new conversation Storing Data With Loops

For example, I have ten fields and Each field will be saved at one row How can I save these values ​​using loops?

Activity icon

Started a new conversation Get All Input Value With Name Attribute

how i can get all inputs value with name Attribute?

Feb
23
7 months ago
Activity icon

Started a new conversation Save And Update Value In Table

I have a form for the settings I want to send the form information to the controller, if that field exists in the table, then update it. But if there was not, create a new field in the table