maximaexchen

Experience

11,410

0 Best Reply Awards

  • Member Since 10 Months Ago
  • 109 Lessons Completed
  • 0 Favorites

2nd February, 2018

maximaexchen left a reply on Vue-form-wizard Change Default Title "Awesome Wizard" • 2 weeks ago

Is this a general lack of vue knowlege, or "vue-form-wizard" specific? I tried to google it but I cannot find out how to change the default props values form here:

http://vuejs.creative-tim.com/vue-form-wizard/#/?id=props

how can I override/update this:

props: {
  title: {
    type: String,
    default: 'Awesome Wizard'
  },
  subtitle: {
    type: String,
    default: 'Split a complicated flow in multiple steps'
  }
}

I am new to this topic. Someon who can bring light? Or show me where to switch light on. ;-)

Thanks in advance and regards.

maximaexchen left a reply on DB Transaction Try Catch Swift_TransportException • 2 weeks ago

Thanks a lot. Helped me a lot.

1st February, 2018

maximaexchen left a reply on DB Transaction Try Catch Swift_TransportException • 2 weeks ago

I did it now like this.

public function register(Request $request)
    {
        DB::transaction(function () use ($request) {
            try {
                $this->validator($request->all())->validate();
                $user = $this->create($request->all());
                UserVerification::generate($user);
                UserVerification::send($user);

                return back()->withAlert(__('Register successfully, please verify your email.'));

            } catch(Swift_TransportException $e){

                return back()->withAlert(__('There was a technical problem. Please contact the technical support'));
            }
        }, 5);
    }

But a new account is created. I think I still did not get it how to use it correctly

maximaexchen left a reply on DB Transaction Try Catch Swift_TransportException • 2 weeks ago

A ok. I see. Thanks.

maximaexchen left a reply on DB Transaction Try Catch Swift_TransportException • 2 weeks ago

Thanks for your reply. What do you mean with "you don't enjoy the benefit of automatic rollback"?

I will try to put DB::rollback() into function register().

maximaexchen started a new conversation Vue-form-wizard Change Default Title "Awesome Wizard" • 2 weeks ago

I want to change the title coming from vue-form-wizard.

It should be done by props. But I cannot figure out where to put the new string.

This is what I have: (new strings in formOptions, but this obvious wrong)

<script>
    import VueFormGenerator from "vue-form-generator";
    import {FormWizard, TabContent} from 'vue-form-wizard'
    import 'vue-form-wizard/dist/vue-form-wizard.min.css'

    export default {

        components: {
            "vue-form-generator": VueFormGenerator.component,
            FormWizard,
            TabContent,
        },
        data() {
            return {
                selectedplan:'',

                model:{
                    firstName:'',
                    lastName:'',
                    email:'',
                    streetName:'',
                    streetNumber:'',
                    city:'',
                    country:'',

                },
                formOptions: {
                    validationErrorClass: "has-error",
                    validationSuccessClass: "has-success",
                    validateAfterChanged: true,

                    title: 'New Title',
                    subtitle: 'New subtitle.',
                    nextButtonText: 'Weiter',
                    backButtonText: 'Zur├╝ck',
                    finishButtonText: 'Abschlie├čen',

                },
                firstTabSchema:{
                    fields:[
                        {
                            type: "awesome",
                            label: "Awesome (custom field)",
                            model: "selectedplan"
                        },
                        {
                            type: "input",
                            inputType: "text",
                            label: "First name",
                            model: "firstName",
                            required:true,
                            validator:VueFormGenerator.validators.string,
                            styleClasses:'col-xs-6'
                        }
                    ]
                },
            }
        },
        methods: {
            onComplete: function(){
                alert('Yay. Done!');
            }
        }
    }
</script>


Someone can help me?

Thanks and regards

25th January, 2018

maximaexchen left a reply on DB Transaction Try Catch Swift_TransportException • 3 weeks ago

@martinbean Thanks for your answer. Oh. Its the complete code. I wanted to post shortend code.... didn't shortend it.

maximaexchen started a new conversation DB Transaction Try Catch Swift_TransportException • 3 weeks ago

Hi there,

I try to build a small registration process and have some handling problems.

Here my shortend code.


public function register(Request $request)
{
    try {
        $this->validator($request->all())->validate();
        $user = $this->create($request->all());
        UserVerification::generate($user);
        UserVerification::send($user);
        return back()->withAlert(__('Register successfully, please verify your email.'));

    } catch(Swift_TransportException $e){
        return back()->withAlert(__('There was a technical problem. Please contact the technical support'));
    }
}

protected function create(array $data)
{
    DB::beginTransaction();

   
    $account = Account::create([
        'name' => $accountname,
        'companyname' => $companyname,
    ]);

    $user =  User::create([
        'name' => $data['name'],
        'email' => encrypt($data['email']),
        'password' => bcrypt($data['password']),
        'account_id' => $account->id,
        'last_login' => Carbon::now()
    ]);

    $user->assignRole(['Accountadmin']);

    $client =  Client::create([
        'account_id' => $account->id,
        'company' => $companyname,
        'name' => $accountname,
        'default' => 1,
        'activated' => 1,
    ]);

   
    if(!$user || !$account || !$client) {
        DB::rollBack();
    } else {
        DB::commit();
        return $user;
    }
}

Obvious I have some logical problems. If there is a TransportException the account and user are created anyhow. Could someone give me a hint how I should catch any errors during registration process.

Thanks in advance. Regards

18th January, 2018

maximaexchen left a reply on Cashier - Multiple Payment Methods • 1 month ago

oh no. That was misleading. I dont't want to prefill. The values should come from the formfields... I am not that good in JS so I think I have the problem to get the values set from user input to the token.

Select plan C -> select payment method B -> submit -> stripe magic

maximaexchen started a new conversation Cashier - Multiple Payment Methods • 1 month ago

Hi there,

I have a default working checkout form with stripe creditcard payment possibility based on this tutorial: https://github.com/drehimself/stripe-elements-with-laravel/blob/master/resources/views/checkout.blade.php

And don't have any clue how and where to add the possibility to add multiple payment methods to that form. I need to use stripe.js and elements, right?

I cannot figure out to add something like this:

var sepadebit = stripe.createSource({
            type: 'sepa_debit',
            sepa_debit: {
                iban: 'DExxxxxxxxxxxxx',
            },
            currency: 'eur',
            owner: {
                name: 'Max Mustermann',
            },
        }).then(function(result) {
            // handle result.error or result.source
        });

And how do I fill it dynamically from input fields?

Anyone who can give me a push in a right direction?

Thanks in advance Regards

24th November, 2017

maximaexchen left a reply on Generate A Secured Url • 2 months ago

@martinbean Thanks! That looks promising.

maximaexchen left a reply on Generate A Secured Url • 2 months ago

Thanks a lot. I am not right shure if I got it. But i try to test your advices.

23rd November, 2017

maximaexchen left a reply on Generate A Secured Url • 2 months ago

Thanks for your reply! I think my description was a bit missleading. Sorry.

Simply spoken I need a way to generate limited lifetime secured url for a "guest" visitor who is unknown to the system. For someone who needs temporaryly acces to the user-data.

I hope my description makes more sense now.

22nd November, 2017

maximaexchen started a new conversation Generate A Secured Url • 2 months ago

Hello,

is there a possibility to generate a limited lifetime url to a page/content which you normally only can access if you are an authenticated and logged-in user.

For example as a authenticated user I want to grant access to my personal content without login with something like a encoded url www.mysite.com/kfhw3ak57jfhda6sk6hfp932sdfsd

Thankfull for any tip.

Regards

maximaexchen left a reply on Check BelongsToMany Before Deleting It • 2 months ago

Ok. I got it.

I added

$table->foreign('procedure_id')->references('id')->on('procedures');
$table->foreign('thirdcountry_id')->references('id')->on('thirdcountries');

in the migration. That did the trick.

maximaexchen left a reply on Check BelongsToMany Before Deleting It • 2 months ago

Ok. Thanks! I think the way to check it on database level would be the best.

but I don't get it. Is it possible to set constrains on pivot_table via migration? My migration looks like this:

Schema::create('procedure_thirdcountry', function (Blueprint $table)
{
            $table->integer('procedure_id')->unsigned();
            $table->integer('thirdcountry_id')->unsigned();
            $table->primary(['procedure_id', 'thirdcountry_id']);
});

Or do I need another way ?

maximaexchen started a new conversation Check BelongsToMany Before Deleting It • 2 months ago

Hello. I could not find a answer...

What would be the best way to prevent deleting a belongsToMany model wich is related to some other models. So I could set a warning "This model could not be deleted, because it is in unse by....."

Thanks in advance for any advice.

Regards

20th October, 2017

maximaexchen left a reply on Problem With Dusk Setup • 3 months ago

Nobdy?

Too simple? Overseen something? Have a link?

Regards

19th October, 2017

maximaexchen started a new conversation Problem With Dusk Setup • 4 months ago

Hey,

I try to setup testing with Dusk. Project is on a local mac with virtualhost testproject.dev (with Dnsmasq)

I cannot figure out how to configure the driver.

Defaults in DuskTestCase

/**
     * Prepare for Dusk test execution.
     *
     * @beforeClass
     * @return void
     */
    public static function prepare()
    {
        static::startChromeDriver();
    }

    /**
     * Create the RemoteWebDriver instance.
     *
     * @return \Facebook\WebDriver\Remote\RemoteWebDriver
     */
    protected function driver()
    {
        $options = (new ChromeOptions)->addArguments([
            '--disable-gpu',
            '--headless'
        ]);

        return RemoteWebDriver::create(
            'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY, $options
            )
        );
    }

And the Test:

/** @test */
    public function testIsLoggedInAdmin()  {

        $user = User::where('email', '=', '[email protected]')->firstOrFail();

        Auth::login($user);

        $this->browse(function ($browser) use ($user) {
            $browser->visit('/')
                ->assertSourceHas('<nav class="nav navbar-nav ml-auto">');
        });
    }

I always get a 404-Page.

Where can I tell Dusk to browse http://testproject.dev

testproject.dev is set in .env and config/app.php

Some advices?

Thanks in advance and regards.

12th October, 2017

maximaexchen left a reply on Strange Behavior After Migration • 4 months ago

Ah ok. Makes sense. Thanks a lot for the explanation.

maximaexchen left a reply on Strange Behavior After Migration • 4 months ago

in the controller

 public function index()
    {

        $clientId = Session::get('client_id');
        $client =  Client::whereId($clientId)->firstOrFail();
        $persons = Person::where('client_id', $clientId)->get();

        return view('manager.account.clients.person.index', compact('persons'));
    }

maximaexchen started a new conversation Strange Behavior After Migration • 4 months ago

Hey there.

I made a new migration

 php artisan make:model Models/Person -mcr

Strangely a migration file with the name "2017_1011_121554_createpeoples_table.php" was created. Model and controller had the correct term Person. Now if a call a view in wich the person Model is called I get the error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'belabimba.people' doesn't exist (SQL: select * from `people` where `client_id` = 3)

I could not figure out why still table people is addressed. When I put

protected $table = 'persons';

to the model everything is fine. I try to understand what is going on. Is person somehow reserved? Is it cached somewhere I could not find? I also renamed the migration file manually to persons and did a migration:refresh. No effect. Any advice where to look.

Regards and thanks advance Marcus

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.