php – laravel get request to model in protected variable-ThrowExceptions

Exception or error:

I want to send request in function controller to protected variable my model

My controller. send $request->NAME; to My model

   class InfoController extends Controller
    {
        public function index(Request $request)
        {
           //send $request->NAME to My model
        }
    }

My model. Get request from controller $request->NAME;

class Info extends Model
{
    protected $table = $request->NAME'.BND_ST_INFO'; //Get request from controller
    public $timestamps = false;
    protected $primaryKey = null;
    public $incrementing = false;
    protected $fillable = ['ID','INFO_NAME'];
}
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *