Welcome Guest, Not a member yet? Register   Sign In
Mutli Application Calling Model From Shared Site In Single Installation Codeigniter 4
#4

(This post was last modified: 11-16-2022, 09:40 PM by iRedds.)

To do what you want, your model must have a namespace other than the default one.
By default, models have the \App\Models namespace.

PHP Code:
// You need to add namespace in application 1 and application 2 configs
'Source\Models' => 'path/to/app/Models/'

// change class to
namespace Source\Models;
classSettings { }

// And in both applications call 
= new \Source\Models\Settings(). 

In general, it is better to move the model into a separate module, which can be connected in both applications.
Reply


Messages In This Thread
RE: Mutli Application Calling Model From Shared Site In Single Installation Codeigniter 4 - by iRedds - 11-16-2022, 09:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB