reza01

reza01

Member Since 4 Years Ago

Experience Points
1,150
Total
Experience

3,850 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
21
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
1,150 XP
Sep
14
1 month ago
Activity icon

Started a new Conversation Laravel Nova As Backend Catch All Routes

I try to build an app with laravel nova as backend and vuejs as front end . im using router-vue for my vue route management i need to setup two main routes that catch all the nova routes and another one to catch all the vue-router routes so far i came up with this:

Route::get('/{any}')->where('any', '^(?!admin|nova-api).*$');

Route::any('/vue/{any}', 'ApplicationController')->where('any', '.*');

i can catch all the nova routes but sadly i can't catch the vue router how can i do it ?

Sep
12
1 month ago
Activity icon

Started a new Conversation Vuesax As Front End And Laravel Nova Backend

Hi! I'm trying to use the Vuesax as front end and Laravel nova as backend but after i installed the Laravel nova it can't recognize example.com/nova url and it's straight goes to my 404 page which i setup with vuesax ,

How can i include the Laravel Nova routes into my currency laravel Vuesax route.js ?

i need to set up Like for /nova and all my front end routes handle by my current vuesax route which is as below

import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
mode: 'history',
base: '/',
routes: [

  {
// =============================================================================
// MAIN LAYOUT ROUTES
// =============================================================================
    path: '',
    component: () => import('./layouts/main/Main.vue'),
    children: [
  // =============================================================================
  // Theme Routes
  // =============================================================================
      {
        path: '/',
        name: 'home',
        component: () => import('./views/Home.vue'),
      },
      {
        path: '/page2',
        name: 'page2',
        component: () => import('./views/Page2.vue'),
      },
        {
            path: '/profile',
            name: 'profile',
            component: () => import('./views/pages/Profile.vue'),
        },
    ],
  },
// =============================================================================
// FULL PAGE LAYOUTS
// =============================================================================
  {
    path: '',
    component: () => import('@/layouts/full-page/FullPage.vue'),
    children: [
  // =============================================================================
  // PAGES
  // =============================================================================
      {
        path: '/pages/login',
        name: 'pageLogin',
        component: () => import('@/views/pages/Login.vue')
      },
      {
        path: '/pages/error-404',
        name: 'pageError404',
        component: () => import('@/views/pages/Error404.vue')
      },
        
    ]
  },
  // Redirect to 404 page, if no match found
  {
    path: '*',
    redirect: '/pages/error-404'
  }
],
})

export default router
Sep
08
1 month ago
Activity icon

Started a new Conversation Laravel Nova Vue-material Failed To Load

Hi, i'm developing Nova tool that i need to use vue material or any other bootstrap style in my tool and it can successfully build the NPM but still in the view it's fail to load any elements: ( here is my Tool.vue) and i already successfully installed the vue-material

<md-app-drawer md-permanent="full">
    <md-toolbar class="md-transparent" md-elevation="0">
        Navigation
    </md-toolbar>

    <md-list>
        <md-list-item>
            <md-icon>move_to_inbox</md-icon>
            <span class="md-list-item-text">Inbox</span>
        </md-list-item>

        <md-list-item>
            <md-icon>send</md-icon>
            <span class="md-list-item-text">Sent Mail</span>
        </md-list-item>

        <md-list-item>
            <md-icon>delete</md-icon>
            <span class="md-list-item-text">Trash</span>
        </md-list-item>

        <md-list-item>
            <md-icon>error</md-icon>
            <span class="md-list-item-text">Spam</span>
        </md-list-item>
    </md-list>
</md-app-drawer>

import { MdButton, MdContent, MdTabs, MdApp } from 'vue-material/dist/components'
import 'vue-material/dist/vue-material.min.css'
import 'vue-material/dist/theme/default.css'


export default {
    components: {
        MdButton,
        MdContent,
        MdTabs,
        MdApp
    },
    data() {
        return {

        }
    },


mounted() {



},

}

Sep
05
1 month ago
Activity icon

Replied to Nova Custom Create/detail View

any help , i'm stuck in there too

Aug
09
2 months ago
Activity icon

Replied to 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;

}
Aug
08
2 months ago
Activity icon

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

Jul
19
3 months ago
Activity icon

Replied to 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.

Activity icon

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

Activity icon

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

Jul
18
3 months ago
Activity icon

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

Jul
17
3 months ago
Activity icon

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?