Coder Restaurant is a Ruby on Rails restaurant website let users order foods.
Submitted by: Your Name
Time spent: XX hours spent in total
URL: heroku-app-url
| def flatten(element) | |
| return [element] unless element.is_a?(Array) | |
| new_array = [] | |
| element.each do |i| | |
| new_array += flatten(i) | |
| end | |
| new_array | |
| end | |
| array = [1, [2, 3, [5, 6], 7], [8, 9], 10, [1, [2, 3, [5, 6], 7], [8, 9], 10]] |
| class CreatePostsTable extends Migration { | |
| public function up() | |
| { | |
| Schema::create('posts', function(Blueprint $table) { | |
| $table->increments('id'); | |
| foreach (array_keys(LaravelLocalization::getSupportedLocales()) as $lang) { | |
| //add here all you translatable attributes | |
| $table->string('title_'.$lang)->nullable()->default(null); |
| php artisan config:publish mcamara/laravel-localization | |
| php artisan view:publish mcamara/laravel-localization |