Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

nnjeim

Experience

2,280

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 21 Lessons Completed
  • 0 Favorites

15th November, 2017

nnjeim started a new conversation Constructor In Model Class • 4 weeks ago

Hi all,

how to add a constructor is a model extending eloquent class?

i have tried to add a constructor but the fill function stop working properly.

14th November, 2017

nnjeim left a reply on Passing Data To Event • 1 month ago

Hi,

you need to pass this to the closure

Event.$on('lead-created', function(val) {
        this.reminders.count += val // returns undefined, there is a problem
      })

or use the arrow function here

13th November, 2017

nnjeim left a reply on Session Issue • 1 month ago

Hi Talinon,

I did as indicated.

Your doubt was right, no file is created in the sessions directory.

nnjeim left a reply on Session Issue • 1 month ago

Hi Talinon,

i have verified all group routes are being attributed Auth and Admin (copy of web) in kernel... the routes are being used in a prefixed group ('admin'). i am attaching here below the kernel definition

'admin' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

i am doubting that the issue is related to prefixed routes...

nnjeim left a reply on Session Issue • 1 month ago

Hi robrogers3,

i am using scoped controllers.

app\Http\Company\CompanyController is where the session is set.

public function setCompany(Request $request) { $company_id = $request->input('company_id'); $request->session()->forget('company_id'); $request->session()->put('company_id', $company_id);

    return back();
}

but i am trying to use the session setting in blade and in other controllers sessions. other controllers are in different scopes.

in addition i think i need to mention that i am using the database driver, but i also reverted back to the file driver and it didn't fix the problem.

what i am sure of is that in the CompanyController the session is being set correctly because i responsed with session('company_id') and the response was correct.

but calling the session from elsewhere is returning null in the model. sometimes it set it to a value but cannot overwrite.

as u can notice up in the code i am also applying forget to make sure the session attribute is flashed but still this is not helping.

Thanks in advance for the patience you are talking to read all this.

12th November, 2017

nnjeim left a reply on Session Issue • 1 month ago

Hi Talinon,

i have added Session::save() after the put, this does not seem to change the problem. i have returned the session('company_id') from the controller and it is returning correctly when i toggle between different companies.

I discovered that the issue is that the session is returning null in other controllers, models or blade views.

anyone ever encountered something similar?

nnjeim left a reply on Session Issue • 1 month ago

Hi robrogers3,

in the submitted for there is a named select element, the select action submits the form to a route controller. I already validated that the selected value is submitted correctly by returning it to the view. It is clear that the problem resides in the session setting. I have read somewhere that this problem is related to scoped routes. Any suggestion here?

11th November, 2017

nnjeim left a reply on Call Controller Method From Vue • 1 month ago

Hi, do you want to download a pdf file, or export the view in pdf?

nnjeim left a reply on Session Issue • 1 month ago

Hi and thanks for your replies.

On selector value change I am submitting a form from blade to a route controller.

from JS event.preventDefault(); document.getElementById('set-company-id').submit();

the controller method is as below $request->session()->put('company_id', $company_id); return back();

i am printing in the blade view {{ session('company_id') }}

On the first selector change the value is set to 1 for example then on subsequent changes it remains as 1.

I tried to return the value of company_id from the controller and it was returning correctly.

So i came to the conclusion that the problem is in the session setting.

I also tried to change the session driver from database back to file.... the result remained the same.

nnjeim started a new conversation Session Issue • 1 month ago

I am using Laravel 5.4 and i am setting the session at the controller level.

A selector change in blade submits the new value to be set in the session.

following the first request the session variable is not being overritten..

what i am missing here? any hint?

$request->session()->put('company_id', $company_id);

Edit Your Profile
Update

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