reza01

reza01

Member Since 4 Years Ago

Experience Points 890
Experience Level 1

4,110 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 20
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.

09 Aug
1 week ago

reza01 left a reply on Create Dynamic Number Of Cards In Laravel Nova

i have managed to find the answer by remove the return and make it like this:

 public function cards(Request $request)
{
   //get all current users accounts
    $accounts = $this->getAccounts($request->user());

    foreach($accounts as $account) {
        $res[] = (new LinkableRouter)->title($account->currency()->first()->symbol . ' ' . $account->balance)
            ->url('{"name": "index", "params": {"resourceName": "accounts"}}')
            ->subtitle($account->acc);
    }
        return $res;

}
08 Aug
1 week ago

reza01 started a new conversation Create Dynamic Number Of Cards In Laravel Nova

i try to show dynamic numbers of cards in my dashboard how can i do it? in my app each user has few accounts and i need to show the accounts as card how can i define a loop in the return card array ?

    public function cards(Request $request)
{
    $accounts = $this->getAccounts($request->user());


    return [
        function($accounts){
            foreach($accounts as $account) {
                (new LinkableRouter)
                    ->title($account->currency()->first()->symbol . ' ' . $account->balance)
                    ->url('{"name": "index", "params": {"resourceName": "accounts"}}')
                    ->subtitle($account->acc);
            }
        },

    ];
}

to make it much more understandable lets say i want to make 3 cards in my dashboard with a for loop:

 public function cards(Request $request)
{
    $accounts = $this->getAccounts($request->user());


    return [
        function(){
           for ($i=0;$i<3;$i++){
               new OfficerCard;
           }
        },

    ];
}

i keep getting the following error:

Call to undefined method Closure::authorize()

Exception Details

Type Symfony\Component\Debug\Exception\FatalThrowableError Location C:\xampp4\htdocs\newgdi\vendor\laravel\framework\src\Illuminate\Support\HigherOrderCollectionProxy.php:60

19 Jul
4 weeks ago

reza01 left a reply on Nova Polymorphic Relationship, Make Things Work

i solved it somehow the laravel create "addressBooktable_type" except of " address_booktable_type" and i have manually changed the column name.

reza01 started a new conversation Nova Polymorphic Relationship, Make Things Work

i try to setup a polymorphic relationship for my nova application as follow: i have company , profile and addressBook table that both the company and profile need to use the addressBook table to record the address's the relations are : company has many address Profile has many address the migration for profile is :

public function up()
    {
        Schema::create('profiles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('first_name');
            $table->string('last_name');
        $table->string('passport_no')->nullable();
        $table->string('DOB');
        $table->string('mother_name');
        $table->string('father_name');
        $table->string('country');
        $table->bigInteger('customer_id')->unsigned();;
        $table->foreign('customer_id')->references('id')->on('customers');
        $table->timestamps();
    });
 }

the Migration for the Company:

public function up()
        {
Schema::create('companies', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('name');
        $table->string('reg_no');
        $table->unsignedBigInteger('customer_id');
        $table->foreign('customer_id')->references('id')->on('customers');
        $table->timestamps();
     });

}

and the migration for the addressBook

public function up()
        {
Schema::create('address_books', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('address_line_1');
        $table->string('address_line_2');
        $table->string('city');
        $table->string('postal_code');
        $table->string('state');
        $table->string('type');
        $table->morphs('addressBook');
        $table->string('country');
        $table->bigInteger('customer_id')->unsigned();;
        $table->foreign('customer_id')->references('id')->on('customers');
        $table->bigInteger('profile_id');

        $table->timestamps();
     });

}

and here are the models: the profile model:

public function addressbooks(){
     return $this->morphMany(AddressBook::class,'AddressBooktable');
 }

the company model

public function addressbooks(){
     return $this->morphMany(AddressBook::class,'AddressBooktable');
 }

the address book model:

 public function addressBooktable(){

    return $this->morphTo();
 }

and the nova fields for profile:

  public function fields(Request $request)
     {
       return [
        ID::make()->sortable(),
        Text::make('First Name','first_name'),
        Text::make('last name','last_name'),
        Text::make('passport number','passport_no'),
        Text::make('Father name','father_name'),
        Text::make('Mother name','mother_name'),
        Date::make('Date of birth','DOB'),
        Country::make('country'),
        BelongsTo::make('Customer'),
        MorphMany::make('AddressBook'),
      ];
    }

and here is the field for Address Book:

 public function fields(Request $request)
   {
      return [
        
        ID::make()->sortable(),
        $this->addressFields(),
        Select::make('type')->options([
            'home' => 'home',
            'office' => 'office'
        ]),
        MorphTo::make('Address Type','addressBooktable')->types([
           // company::class,
            Profile::class,
          ])
      ];
  } 

no one i try to submit the new record for the address i keep getting the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'address_booktable_type' in 'field list' (SQL: 
insert into `address_books` (`address_line_1`, `address_line_2`, `city`, `state`, `postal_code`, `country`, 

type, address_booktable_type, address_booktable_id, updated_at, created_at) values (B3-33A-13, Empire Damansara, ?, Petaling Jaya,, selangor, 47810, MY, home, App\Profile, 1, 2019-07-19 09:24:35, 2019- 07-19 09:24:35))

here is the telescope page:

address_line_1: "B3-33A-13, Empire Damansara", address_line_2: null, city: "Petaling Jaya,", state: "selangor", postal_code: "47810", country: "MY", type: "home", addressBooktable: "1", addressBooktable_type: "profiles", addressBooktable_trashed: "false", viaResource: null, viaResourceId: null, viaRelationship: null }

any help???

reza01 left a reply on How To Add Confirmation Details Page Before Form Submitting?

I'm Using normal nova resources that to record a transaction in my database as follow : public function fields(Request $request) { $balance = Account::getAccount(Auth::user(),'saving')->balance; // $balance = Account::where('acc',) return [ Text::make('TRX','trx')->hideWhenUpdating()->hideWhenCreating(),

        Select::make('From','sender_account_id')->options([
            Account::getAccount(Auth::user(),'saving')->acc =>
                Account::getAccount(Auth::user(),'saving')->acc
        ])->hideWhenUpdating(),

        Text::make('To','receiver_account_id')->hideWhenUpdating()->rules('required'),

        Text::make('Receiver First Name')->hideWhenUpdating()->rules('required',new ValidReceiverFirstName(Input::get('receiver_account_id'))),
        Text::make('Receiver Last Name')->hideWhenUpdating()->rules('required',new ValidReceiverLastName(Input::get('receiver_account_id'))),


        //TODO: change on ubuntu to Currency::make
        Number::make('amount')->hideWhenUpdating()->rules('integer',new ValidBalance(Input::get('sender_account_id'))),

        BelongsTo::make('currency')->hideWhenUpdating(),

        Text::make('type')->hideWhenUpdating()->hideWhenCreating(),

        Text::make('explanation')->hideWhenUpdating(),

    ];
}

but i need to add one more step before the form submission that shows all the filled forms needs to submit before save then after user confirm it then it goes for save all details into database. should i make new tools or still i can edit the resource view's page?

18 Jul
4 weeks ago

reza01 left a reply on How To Add Confirmation Details Page Before Form Submitting?

thanks , can i use it in resources or i have to use it only in tools ?

17 Jul
1 month ago

reza01 started a new conversation How To Add Confirmation Details Page Before Form Submitting?

i'm building an application with laravel nova and looking for a form confirmation page that view forms details before create record in database?