Author Archive: Tuna Ünlüeroğlugil

artisan db:seed error


use Illuminate\Database\Seeder;

class UserCreateSeeder extends Seeder
{
.........
}

Hata

artisan db:seed UserCreateSeeder

[Symfony\Component\Console\Exception\RuntimeException]
Too many arguments, expected arguments "command".

Çözümü

 

artisan db:seed --class="UserCreateSeeder"

 

opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb parse (Psych::SyntaxError)

$ vagrant up
/opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (): found a tab character that violate intendation while scanning a plain scalar at line 30 column 7 (Psych::SyntaxError)
from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:318:in `parse'
from /opt/vagrant/embedded/lib/ruby/2.2.0/psych.rb:245:in `load'
from /Users/KleTuna/Homestead/Vagrantfile:20:in `block in '
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `vagrantfile'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in `host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:208:in `block in action_runner'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:473:in `hook'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:722:in `unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `ensure in '
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `'

 Because your Homestead.yaml file contains ‘tabs’ instead of spaces.

Homestead.yaml dosyasında tab veya boşluş hatası var.

Mac Gizli Dosyaları/Klasörleri Göstermek/Gizlemek

Gizli klasör ve dosyaları göstermek için:

defaults write com.apple.finder AppleShowAllFiles -bool YES


Gizli klasör ve dosyaları tekrar görünmez hale getirmek için:

defaults write com.apple.finder AppleShowAllFiles -bool NO

Her iki komutu yazıp enter tuşuna bastıktan sonra aşağıdaki komut ileFinder‘i yeniden başlatalım.

killall Finder

Increase the PHP memory limit with MAMP PRO

Most PHP applications can easily handle the default PHP memory limit of 8 MB. But more complex web applications, like content management- or blog-systems, do need an increased memory-limit. With MMAP PRO you can easily increase the PHP memory limit. Therefore you simply have to change some data within the php.ini file.

Here is how it works:

  1. Start MAMP PRO
  2. Stop the server if it’s running
  3. Choose Menu -> File -> Edit Template -> PHP4 php.ini (If you want to change the memory limit for PHP5, then choose PHP5 php.ini)
  4. The PHP ini file will be opened.
  5. If a dialogue box pops up, read it and confirm with OK
  6. Search (Command-F) for “memory_limit” (without quotes)
  7. You should get the following line:
    memory_limit = 8M ; Maximum amount of memory a script may consume (8M)
  8. Now you can change the default value of 8M. For instance. into 32M or even more (like 128M)
  9. Save (Command-S) your changes.
  10. Close (Command-W) the file.
  11. Start the Server.

Now all PHP scripts can make use of the increased memory.

Please be aware of the fact that some ISP’s are limiting the PHP Memory by default. This means, even if everything works fine on your local system, it probably will not work on the live system of your ISP.

Kaynaklar:

http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html

 

 

Mac Klavye Kısayolları

Mac’e ilk geçtiğimde klavye kısayollarının ne kadar pratik olduğunu farketmem çok uzun sürmemişti. Ancak Windows’tan Mac’e geçen birisi olarak kullandığım kısayolların Mac karşılıklarını öğrenmek için zaman harcamadığımı söyleyemem. Zira Mac ve Windows’ta hem benzer hem de farklı isimlerde özel tuşlar var. Bu tuşların anlamları, kombinasyonları ve işlevleri de farklı olabiliyor. Bu yazıda hem bu tuşları, hem de kişisel olarak kullandığım ve Mac’e yeni geçenlerin işine yarayacağını düşündüğüm bazı temel klavye kısayollarını bulabilirsiniz…

Kaynak: http://www.sihirlielma.com/2009/10/26/mac101-klavye-kisayollari-i/

 

Xdebug – Professional PHP Debugging

What Is Xdebug?

Well, technically, Xdebug is an extension for PHP to make your life easier while debugging your code. Right now, you may be used to debugging your code with various other simple solutions. These include usingecho statements at different states within your program to find out if your application passes a condition or to get the value of a certain variable. Furthermore, you might often use functions like var_dumpprint_ror others to inspect objects and arrays.

What I often come across are little helper functions, like this one for instance:

 

Yazının devamı:

http://net.tutsplus.com/tutorials/tools-and-tips/xdebug-professional-php-debugging/