maximaexchen

Experience

11,080

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 108 Lessons Completed
  • 0 Favorites

24th November, 2017

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

@martinbean Thanks! That looks promising.

maximaexchen left a reply on Generate A Secured Url • 2 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 • 1 month ago

Nobdy?

Too simple? Overseen something? Have a link?

Regards

19th October, 2017

maximaexchen started a new conversation Problem With Dusk Setup • 1 month 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 • 2 months ago

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

maximaexchen left a reply on Strange Behavior After Migration • 2 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 • 2 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.