lundi 5 septembre 2016

How to MySQL Query in Laravel 5?

I need to eliminate the specific prefix of a string by default on getting value from the database.

In MySQL, i can use the following,

SELECT RIGHT('abc3',1) -- Results in "3"
SELECT RIGHT('abc3',2) -- Results in "c3"

But, how can i use same process in Laravel Elaquent.

Or any other solutions are available for remove the prefix of a string while retrieve from database in laravel.

I know trim will eliminate, but only spaces.

ex.
 property_color
 property_size

Here i need to extract "property_".

expect.
  color
  size

Is it possible in laravel, in without using PHP String function.

Only on Direct Elaquent Operation.

Thanks in Advance !



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire