Posts

ReCAPTCHA V3 Kullanımı

 https://github.com/biscolab/laravel-recaptcha https://artisansweb.net/a-guide-on-adding-google-recaptcha-v3-to-your-laravel-website/ <head> < meta name = "csrf-token" content = "{{ csrf_token() }}" > < script type = "text/javascript" >     function callbackThen ( response ) {         // read Promise object         response . json (). then ( function ( data ) {             console . log ( data );             if ( data . success && data . score > 0.5 ) {                 console . log ( 'valid recpatcha' );             } else {                 document . getElementById ( 'co-sign-in-form' ). addEventListener ( 'submit' , function ( event ) {                     event . preventDefault ();                     //alert('recpatcha error');                     toastr . error ( "Recpatcha error" )                 });             }         });     }     function callbackCatch ( error )

Laravel Events

Image
 Kaynak: https://www.sakirmehmetoglu.com.tr/laravelde-event-ve-notification-arasindaki-fark-nedir Kaynak:  https://dev.to/kingsconsult/laravel-8-events-and-listeners-with-practical-example-9m7 php artisan make:listener EventTestListener

Laravel migration err

   SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `tenants` add primary key ` tenants_id_primary`(`id`)) Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes laravel 8 PHP By  Lokesh003  on May 15 2021  Donate Thank Comment Some Solution that worked for me : ( Try running command after config : clear and try migrate : fresh ) 1. added default string length : use Illuminate \ Support \ Facades \ Schema ; public function boot ( ) { Schema :: defaultStringLength ( 191 ) ; } 2. changing engine to 'InnoDB' inside / config / database . php 'mysql' = > [ . . . , . . . , 'engine' = > 'InnoDB' , ] 3. If still not solved try updating 'charset' and 'collation' inside / config / database . php 'charset' = >

Laravel Migrations Generator

Image
  Generate Laravel Migrations from an existing database, including indexes and foreign keys! https://github.com/kitloong/laravel-migrations-generator laravel migrationsları ilk olarak çalıştırma komutu; 1 php artisan migrate bu işlemi geri almak için 1 php artisan migrate : rollback kendi tablomuzu oluşturmak için komutumuz 1 2 3 php artisan make : migration create_urun_table -- create = urun   / * en sondaki tablo ismi ona g ö re https://laravel.com/docs/5.8/migrations kolon tiplerini burada görebilirsiniz. örnek olması için: 1 2 3 4 5 6 $ table -> Increments ( 'id' ) ; // otomatik arttırıyor sadece bu kadar   $ table -> bigIncrements ( 'id' ) ;              $ table -> string ( 'name' ) ;              $ table -> string ( 'airline' ) ;              $ table -> timestamps ( ) ; // otomatik create update kolonları php artisan migrate ile veritabanına uygulayabiliriz tekrardan. sonradan bir kolon ekleyeceksek; 1 php artisan make : migrati