lakmalp

Experience

150

0 Best Reply Awards

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

3rd April, 2017

lakmalp started a new conversation Route To Different Code Bases • 6 months ago

I need to route to a different codebase based on logged in User's Company. Please do let me know can this be done. If so, please do let me know how to do it. But the URL for both the users should be identical. That is, "http://xxx.com/home" should serve from different codebases based on user.

14th March, 2017

lakmalp left a reply on Variable Access Issue From Blade Template • 7 months ago

@Snapey Thanks for the explanation. But it does limit its flexibility it seems. I couldn't use Eloquent since I need to have more than one columns for the PRIMARY KEY of this table.

lakmalp left a reply on Variable Access Issue From Blade Template • 7 months ago

@SaeedPrez My goodness! It worked! Thanks a zillion (Y)

lakmalp left a reply on Variable Access Issue From Blade Template • 7 months ago

@Abi Tried and it didn't work either

lakmalp left a reply on Variable Access Issue From Blade Template • 7 months ago

@SaeedPrez My model is not Eloquent. Will

$companies = Company::pluck('description', 'company_id');

work?

lakmalp left a reply on Variable Access Issue From Blade Template • 7 months ago

Yeah the error says the same... But I need to know how to fix it... Thanks for your reply.

lakmalp started a new conversation Variable Access Issue From Blade Template • 7 months ago

I get htmlentities() expects parameter 1 to be string, object given error when I use $companies variable in VIEW. I want description to be shown in the combo whereas company_id as the names of each option.

CONTROLLER:

$companies = Company::getAllCompanies();
return view('appuser.create', compact('companies'));

MODEL (Company):

public static function getAllCompanies()
{
        
    $result = DB::table(Company::_TABLE_)->select(['company_id', 'description'])->get();
        
    return $result;
}

VIEW:

{!! Form::select('sCompanyId', $companies, null, ['class' => 'col-md-4 form-control', 'style' => 'width:100%;']) !!}
Edit Your Profile
Update

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