Posts

Laravel 8 Google Auth

Image
  Kaynak:  https://codyrigg.medium.com/how-to-add-a-google-login-using-socialite-on-laravel-8-with-jetstream-6153581e7dc9#:~:text=Click%20Create%20Credentials%20%2D%3E%20Oauth%20Client,%2Fauth%2Fgoogle%2Fcallback. How to Add a Google Login using Socialite on Laravel 8 with Jetstream Starting a laravel 8 application with jetstream and then passing the login to Google shouldn’t be hard. There should be a github out that there where’s someone’s already done that, that you can just clone and go from there. I didn’t find one, so I made one with a little help from here:  https://www.nicesnippets.com/blog/laravel-8-socialite-login-with-google-gmail-account Unfortunately, the instructions left me unable to login with google because of the teams in jetstream, so I had to code a decent bit more. Without further ado, here’s the github: https://github.com/codyrigg/socialite-google-laravel8 If you want to do this yourself, here’s how I did it. Start by installing Laravel 8. composer create-project

Laravel 8 - Form işlemi

Image
 Form tanımlama Controller Formlar dolu gelsin

Laravelde Log kayıtlarını günlük olarak tutma

App/start/global.php dosyasında Log::useDailyFiles(storage_path().'/logs/laravel.log');

Laravel Migrations ve otomatik kurulum işlemleri

Önce composer aracılığıyla migration oluşturuyoruz. php artisan migrate:make create_users_table oluşan migration database migrations klasörüne kayıt ediliyor. public function up()     {     Schema::create('modul', function(Blueprint $table) {     $table->engine = 'InnoDB';     $table->increments('id');     $table->string('isim', 50)->default('0');     $table->string('icon', 50)->default('0');     $table->integer('seviye')->default('0');     $table->string('ozel_seviye', 50)->default('0');     $table->string('link', 50)->default('0');     $table->integer('sira')->default('0');     $table->integer('login_gerekli_mi')->default('0');     $table->integer('akordeon_ana')->default('0')->comment = "1 veya 0 girilir 1 girilirse akardeon un üst menüsüdür";     $table->inte

Create migration

php artisan migrate:make create_menu

Laravel Elequent query

$sert =  \Sepetdetay::where("paket_id", $urun)->where("egitim_tipi",             "sert")->where(function ($query){                     $query->where("satis_durumu", "3")->orwhere("satis_durumu", "1000");         })->where("serti", "1")->where("basim", "0")->get();

Laravel Simple Selectbox

// Many of you may know this already, but for those who don't this is really handy for building dropdowns // Suppose you want to show a categories dropdown whose information is pulled from an Eloquent model // You can use the query builder's "lists" method (available for Eloquent as any query builder method) which // returns an associative array you can pass to the Form::select method $categories = Category::lists( 'title' , 'id' ); // note that the parameters you pass to lists correspond to the columns for the value and id, respectively // in this case, "title" and "id" // you should pass this data to your view and then build the dropdown inside it //somewhere in your view {{ Form::select( 'category' , $categories ) }}