Convert print_r result to JSON

As you know json_encode is encoding only array or public properties of an object. But print_r can expose the protected and private properties in an object. Sometimes we need to these hidden properties. For this purpose we can convert print_r result to JSON result. Here is the function we need: if (!function_exists(‘pr2json’)) Devamı…

PHPStorm Auto Import in File Scope

For example you’re developing an app in Laravel. You want to add a new Route to routes/web.phpfile. Route::get(‘payment’, ‘App\\Http\\Controllers\[email protected]’); As you can see you must write class and method name as string. But you can make this better way: Route::get(‘payment’, [App\Http\Controller\PaymentController::class, ‘pay’]); This is better then other becouse you can open Devamı…

JeyBrains ürünlerindeki klavye hatasının çözümü

PHPStorm, Android Studio, WebStorm falan filan hepsi gayet güzel ve işlevsel yazılımlar fakat her yazılımda olduğu gibi onlarda da bazı ufak tefek problemler çıkabiliyor. Linux/Unix tabanlı işletim sistemlerinde bazen klavye işlemiyor bu programlara. Özellikle kod formatladıktan sonra klavye işlevsiz hale geliyor. Bu problemi çözmek için aşağıdaki işlemleri yapmak gerekiyor: Şu Devamı…

önce , admin tarafından

Laravel “Specified key was too long” error solution

For laravel 5.7 to 6.0 Steps to followed Go to App\Providers\AppServiceProvider.php. Add this to provider use Illuminate\Support\Facades\Schema; in top. Inside the Boot function Add this Schema::defaultStringLength(191); that all, Enjoy. https://stackoverflow.com/a/51039039/2132069

önce , admin tarafından