mDelshad

mDelshad

Member Since 9 Months Ago

Experience Points 4,780
Experience Level 1

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 Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

23 May
1 month ago

mDelshad left a reply on Create Foreign Key

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

mDelshad 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.,

mDelshad left a reply on 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

mDelshad left a reply on Migration Problem: Cannot Add Foreign Key Constraint In Laravel

Field   Type    Null    Key     Default     Extra   
id  bigint(20) unsigned     NO  PRI     NULL    auto_increment
provider    enum('MELLAT','SADAD','SAMAN','PARSIAN','MABNA','M...   NO      NULL    
amount  decimal(15,2)   NO      NULL    
order_id    int(11)     YES         NULL    
currency    varchar(3)  YES         NULL    
ref_id  varchar(100)    YES         NULL    
tracking_code   varchar(50)     YES         NULL    
card_number     varchar(50)     YES         NULL    
status  enum('INIT','SUCCEEDED','FAILED')   NO      INIT    
ip  varchar(20)     YES         NULL    
extra   json    YES         NULL    
paid_at     timestamp   YES         NULL    
created_at  timestamp   YES         NULL    
updated_at  timestamp   YES         NULL    
deleted_at  timestamp   YES         NULL    

22 May
1 month ago

mDelshad 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 my 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 :

    public function up()
    {
        Schema::create('gateway_transactions', function (Blueprint $table) {
            $table->engine = "innoDB";
            $table->unsignedBigInteger('id', true);
            $table->integer('user_id')->unsigned();
            $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();
        });
        Schema::table('gateway_transactions', function(Blueprint $table) {
            $table->foreign('user_id')->references('id')->on('users')->onDelete('CASCADE');
        });
    }

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();
        });
    }
08 May
1 month ago

mDelshad 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?

03 May
1 month ago

mDelshad left a reply on 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);
        }
    });
});

mDelshad 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

09 Apr
2 months ago

mDelshad 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?

08 Apr
2 months ago

mDelshad 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?

07 Apr
2 months ago

mDelshad 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

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

05 Apr
2 months ago

mDelshad 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؟

29 Mar
2 months ago

mDelshad 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\Repositories\Frontend\Auth\UserRepository.php
 ------ -----------------------------------------------------------------------------------------------------------------
  37     PHPDoc tag @param has invalid value ($token): Unexpected token "$token", expected TOKEN_IDENTIFIER at offset 19
  54     PHPDoc tag @param has invalid value ($uuid): Unexpected token "$uuid", expected TOKEN_IDENTIFIER at offset 19
  56     Call to an undefined method Illuminate\Database\Eloquent\Model::uuid().
  73     PHPDoc tag @param has invalid value ($code): Unexpected token "$code", expected TOKEN_IDENTIFIER at offset 19
  100    Parameter #1 $prefix of function uniqid expects string, int given.
  108    If condition is always true.
  112    Call to an undefined method Illuminate\Database\Eloquent\Model::assignRole().
  124    Call to an undefined method Illuminate\Database\Eloquent\Model::notify().
  142    PHPDoc tag @param has invalid value ($id): Unexpected token "$id", expected TOKEN_IDENTIFIER at offset 25
  186    Call to an undefined method
         Illuminate\Database\Eloquent\Collection|Illuminate\Database\Eloquent\Model::canChangeEmail().
  196    Parameter #1 $prefix of function uniqid expects string, int given.
  198    Call to an undefined method
         Illuminate\Database\Eloquent\Collection|Illuminate\Database\Eloquent\Model::notify().
  223    PHPDoc tag @param has invalid value ($input): Unexpected token "$input", expected TOKEN_IDENTIFIER at offset 24
  244    PHPDoc tag @param has invalid value ($code): Unexpected token "$code", expected TOKEN_IDENTIFIER at offset 19
  270    PHPDoc tag @param has invalid value ($data): Unexpected token "$data", expected TOKEN_IDENTIFIER at offset 19
  270    PHPDoc tag @param has invalid value ($provider): Unexpected token "$provider", expected TOKEN_IDENTIFIER at
         offset 40
  302    Parameter #1 $user of class App\Events\Frontend\Auth\UserProviderRegistered constructor expects
         App\Models\Auth\User, Illuminate\Database\Eloquent\Model given.
  306    Call to an undefined method
         Illuminate\Database\Eloquent\Model|static(App\Repositories\Frontend\Auth\UserRepository)::hasProvider().
  308    Call to an undefined method
         Illuminate\Database\Eloquent\Model|static(App\Repositories\Frontend\Auth\UserRepository)::providers().
  316    Call to an undefined method
         Illuminate\Database\Eloquent\Model|static(App\Repositories\Frontend\Auth\UserRepository)::providers().
  334    PHPDoc tag @param has invalid value ($fullName): Unexpected token "$fullName", expected TOKEN_IDENTIFIER at
         offset 19
 ------ -----------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------
  Line   app\Repositories\system\Document\DocumentRepository.php
 ------ -------------------------------------------------------------------------------------
  8      Class App\Notifications\backend\auth\RejectDocument referenced with incorrect case:
         App\Notifications\Backend\Auth\RejectDocument.
  9      Class App\Notifications\backend\auth\VerifyDocument referenced with incorrect case:
         App\Notifications\Backend\Auth\VerifyDocument.
  35     Variable $input might not be defined.
  35     Variable $input might not be defined.
  57     Class App\Notifications\backend\auth\VerifyDocument referenced with incorrect case:
         App\Notifications\Backend\Auth\VerifyDocument.
  68     Class App\Notifications\backend\auth\RejectDocument referenced with incorrect case:
         App\Notifications\Backend\Auth\RejectDocument.
 ------ -------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------
  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?

20 Mar
3 months ago

mDelshad 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

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

what is better/faster approach?

mDelshad left a reply on 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

19 Mar
3 months ago

mDelshad 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?

18 Mar
3 months ago

mDelshad left a reply on 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?

mDelshad 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?

mDelshad 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?

15 Mar
3 months ago

mDelshad started a new conversation Problem In Use Switchery In Laravel

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>

mDelshad left a reply on Add Html Tag In Lang File

@SNAPEY - How can i do this?

mDelshad left a reply on 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)
14 Mar
3 months ago

mDelshad 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
09 Mar
3 months ago

mDelshad started a new conversation Undefined Variable In Notification

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

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));

08 Mar
3 months ago

mDelshad 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

06 Mar
3 months ago

mDelshad left a reply on 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>

mDelshad left a reply on 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();
            }
      });
    });
});

mDelshad started a new conversation Submit Form With Sweeto 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();
            }
      });
    });
});
04 Mar
3 months ago

mDelshad left a reply on Update User Information

@CRONIX - thank you I will certainly edit this

mDelshad 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

mDelshad started a new conversation Code Analysis

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

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

mDelshad left a reply on Ajax Request In Sweet Alert

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

mDelshad 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 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
                            });
                        }
                    });
02 Mar
3 months ago

mDelshad 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?

mDelshad 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?

01 Mar
3 months ago

mDelshad left a reply on Create Form Builder

@TRAY2 - Yes, that's exactly that

mDelshad left a reply on 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

mDelshad started a new conversation Create Form Builder

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

28 Feb
3 months ago

mDelshad left a reply on 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?