50% Off/-

50% Off/-

Php

50% Off/-

50% Off/-

Web

50% Off/-

50% Off/-

Latest Added Tutorials

Flutter TextFormField Phone Number Formatter Converts phone number 00000000 to (000) 000 0000 class PhoneNumberFormatter extends TextInputFormatter { PhoneNumberFormatter(); @override TextEditingValue formatEditUpdate( TextEditingValue oldValue, TextEditingValue newValue, ) { if (!oldValue.text.contains("(") && oldValue.text.length >= 10 && newValue.text.length != oldValue.text.length) { return TextEditingValue( text: "", selection: TextSelection.collapsed(offset: 0), ); }...Continue Reading
Laravel Eloquent Column Editing with Yajra Datatables class PrivatePackageController extends AppBaseController { public function index(){ try { $model=PrivatePackage::query(); $result=DataTables::eloquent($model) ->setTotalRecords(100) ->editColumn('price', function(PrivatePackage $privatePackage) { return MoneyUtil::twoDecimalNumber($privatePackage->price/100); }) ->toArray()['data']; return $this->sendResponse($result,''...Continue Reading
Change button text and background color then submit form: <input class="btn btn-primary" onclick="this.style.backgroundColor='red'; this.style.borderColor='red'; this.value='E-Posta Gönderiliyor... Bu işlem 1-2 dakika sürebilir.. Lütfen Bekleyiniz'; document.getElementById('mainForm').submit()" type="submit" value="Gönder" />...Continue Reading
Base Model for Laravel Mssql Datetime Configuration use Illuminate\Database\Eloquent\Model; abstract class BaseModel extends Model { protected $dateFormat = 'Y-m-d H:i:s.u'; public function getDateFormat() { return 'Y-m-d H:i:s.u'; } public function fromDateTime($value) { return substr(parent::fromDateTime($value), 0, -3); } }...Continue Reading
class ApiHelper { static const String BASE_PATH = "http://api.example.com"; static const String API_PATH = "/api"; Future<ApiResponseModel> request(String url, {Map<String, String> queryParameters, bearerToken = '', isSSL = false}) async { return _innerRequest(url, 'GET',bearerToken,isSSL); } Future<ApiResponseModel> _innerRequest(String url, String type, [postParams,bearerToken = '']) async { url = _getUrl(url); Dio dio = _getDio(bearerToken); try { var response; if(type=='GET')...Continue Reading
PostsDataSource class PostsDataSource(private val scope: CoroutineScope) : PageKeyedDataSource<Int, Question>() { private val repository = QuestionRepository() override fun loadInitial( params: LoadInitialParams<Int>, callback: LoadInitialCallback<Int, Question> ) { scope.launch { try { val response = repository.getQuestionsAsync(1) when { response.success -> { val listing = response.data val...Continue Reading
Fragment import android.os.Bundle import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider import androidx.recyclerview.widget.LinearLayoutManager import com.codesenior.period.tracker.R import com.codesenior.period.tracker.adapters.QuestionAdapter import com.codesenior.period.tracker.factories.QuestionViewModelFactory import com.codesenior.period.tracker.repositories.QuestionRepository import kotlinx.andr...Continue Reading
Axios interceptor for refresh token when you have multiple parallel requests. initAxios() { var thiz = this; Axios.defaults.baseURL = Constants.BASE_API_URL; Axios.defaults.headers.common["Authorization"] = "Bearer 123"; Axios.defaults.headers.common["Accept"] = "application/json; charset=UTF-8"; Axios.defaults.headers.common["Language"] = "TR"; //Axios.defaults.headers.common["Host"] = "localhost:44335";//todo remove in production Axios.interceptors.request.use((request: any) => { console.log("Starting Request", reque...Continue Reading
Events abstract class CounterEvent {} class IncrementEvent extends CounterEvent{} class DecrementEvent extends CounterEvent{} Bloc Class import 'dart:async'; import 'package:fluttertemplate/blocs/bloc.dart'; import 'counter_event.dart'; /// More Detail: /// https://www.didierboelens.com/2018/08/reactive-programming-streams-bloc/ /// https://pub.dev/documentation/rxdart/latest/ /// https://blog.soshace.com/understanding-flutter-bloc-pattern/ class CounterBloc extends Bloc { int _counter = 0; final _counterStateController = StreamController<i...Continue Reading
Events abstract class CounterEvent {} class IncrementEvent extends CounterEvent{} class DecrementEvent extends CounterEvent{} Bloc class import 'dart:async'; import 'package:fluttertemplate/blocs/bloc.dart'; import 'package:rxdart/rxdart.dart'; import 'counter_event.dart'; /// More Detail: /// https://www.didierboelens.com/2018/08/reactive-programming-streams-bloc/ /// https://pub.dev/documentation/rxdart/latest/ /// https://blog.soshace.com/understanding-flutter-bloc-pattern/ class CounterBlocRxDart extends Bloc { int _counter = 0; final _rep...Continue Reading
config/auth.php file 'guards' => [ 'crm_account' => [ 'provider' => 'crm_accounts', 'driver' => 'passport', 'hash' => true, ], ], 'providers' => [ 'crm_accounts' => [ 'driver' => 'eloquent', 'model' => App\Models\CrmAccount::class, 'table' => 'crm_accounts', ], ], CrmAccount Model: namespace App\Models; use Illuminate\Foundation\Auth\User as Authenticatable; use Laravel\Passport\HasApiTokens; class CrmAccount extends Authenticatable { use HasApiTokens; public $fillable = [ 'id', 'name', ]...Continue Reading
Number Increment Decrement Widget import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:kadir_alkan_kuafor/models/general_model.dart'; import 'package:kadir_alkan_kuafor/models/number_increment_decrement_model.dart'; class NumberIncrementDecrement extends StatefulWidget { final NumberIncrementDecrementModel numberIncrementDecrementModel; NumberIncrementDecrement({Key key, this.numberIncrementDecrementModel}) : super(key: key); @override StateContinue Reading
We can use following codes for multiple select in Laravel: Blade Template: <div class="form-group col-sm-6"> {!! Form::label('project_contents', 'Project Contents:') !!} <i>(You can choose multiple items)</i> @if(!isset($project)) {{Form::select('project_contents',$project_contents,null, array('data-placeholder'=>'Seçiniz','class' => 'form-control select','multiple'=>'multiple', 'name'=>'project_contents[]','required'=>''))}} @endif @if(isset($project)) <select multiple="multiple" name="project_conten...Continue Reading
I was getting ERR_CONNECTION_RESET because my Visual Studio 2013/IIS Express configured app port number was NOT in the range :44300-:44398. (I don't recall having to dismiss any warnings to get out of that range.) Changing the port number to something in this range is all I had to do to make it work. I noticed this after reviewing the netsh http show sslcert > sslcert.txt output and something clicking with stuff I read recently about the port numbers....Continue Reading
We can use FTPClient class in apache commons library to send UTF-8 encoded file names, such as Turkish, chinese, german etc. ftpClient = new FTPClient(); String server ="ftp.server.com"; int port = 21; String user ="test"; String pass ="test"; ftpClient.setControlEncoding("UTF-8");//must be before connect() method ftpClient.connect(server, port); ftpClient.login(user, pass); ftpClient.enterLocalPassiveMode(); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); ftpClient.sendCommand("OPTS UTF8 ON");//we should send this command...Continue Reading

© 2019 All rights reserved. Codesenior.COM