php - How to load models in Laravel? -


i started studying laravel , ran problem using models. how load them? example in codeigniter used $model = $this->load->model('some_model'). in laravel when call controller sites::ofuser() work fine, when call sites::getid() says method should static... possible call method without static or need create facades each model?

my model looks this:

namespace models;  use eloquent;  class sites extends eloquent {      public function scopeofuser($query)     {}      public function getid($name)     {} } 

for static method--

$type = sites ::scopeofuser($query);

and if want normal codeingiter use--

$model = new sites ();
$type = $model->scopeofuser($query);


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -