Smart Code FAQ in Swift3 – We Present a smart way to understand how to code with swift3

We Present a smart way to understand how to code with swift3 class ViewController: UIViewController { @IBOutlet weak var tempEntry: UITextField! @IBAction func convertClick(_ sender: UIButton) { //check if there is a text inside TextFiledif let results = tempEntry.text {if (results == “”) { //TextFiled is Emptyreturn}else { //text exists inside TextFiledresultLabel.text = results}}}

Query database

Migration file example Read data with Models create a new model (found models inside app directory. Start laravel playground App\Project::all(); – show all records under project table (collection of items) App\Project::first(); – show all records on the first project. $project = new App\Project; $project->title = ‘my first project’; – insert data to title column. $project->description = ‘my description’; – insert data to description column. $project; – show insert information. $project->save(); Read more…

Databases and Migrations

All tables define as a classes. Migrations migration are like version control for your database. it’s quickly define a scheme for the a table without the need to learn any language. run the migrate: php artisan migrate if tables exists (drop the tables and recreate): php artisan migrate:fresh if any errors – go to database/mirgation inside function up() add this: Schema::defaultStringLength(191); – after then fix run: php artisan migrate:fresh you Read more…

Controllers

Let’s learn how to migrate from route closures to dedicated controllers create new controller: inside route/web.php add this line: inside html/controller: inside resources/views: directory projects (like example) add file index.blade.php Advance Controller *create controller with all Route Resource automatically *create controller & module automatically:

Passing Data Resources

@extends(‘layout’) – display page from resources/view/layout.blade.php @include(‘navbar’) – include the file from resources/view/navbar.blade.php @yield(‘content’) – read data from “section” @section(‘content’) – register section for contect @yield(‘content’)@endsection Use yield & section to pass data Passing page Title @section(‘title’) Welcome HomePage @endsection or you can use: @section(‘title’, ‘Welcome Homepage’) Passing Data between files Route::get(‘/’, function () { $tasks = [ ‘Go to the store’, ‘Go to the market’, ‘Go to work’ ]; Read more…

Laravel Install

Installation Laracasts provides a free, thorough introduction to Laravel for newcomers to the framework. It’s a great place to start your journey. Server Requirements XAMPP (for windows): Composer (to install laravel): getcomposer.org/download/ NodeJS: nodejs.org/en/ Visual Studio Code (Editor): code.visualstudio.com/ The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it’s highly recommended that you use Homestead as Read more…