Skip to content

geek115/Laravel-Swift-Sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel-Swift-Sample

The Swift App Sample with Laravel RESTful API.

Contents

  • Laravel Project for RESTful API (6.5.1 released) - [ApiServer]
  • The iOS Project using API (Swift 5.0) - [TestApi]

Pre-Requisites

  1. MacOS Mojave 10.14.3 or above
  2. Git
  3. Apache2, PHP 7.2 or above, MySQL or MariaDB
  4. Composer
  5. Xcode 11.0 or above To test the app on physical device, You'll need an Apple Developer Account
  6. CocoaPods

Installation

Clone the repository in your pc using git.

$ git clone https://github.com/superdev115/Laravel-Swift-Sample.git
$ cd Laravel-Swift-Sample

Laravel Project

  • Install the application's dependencies with Composer
    $ cd ApiServer
    $ composer install
  • Create a new database for project. (MySQL). You can use Terminal like this
    mysql -u root -p
    mysql> CREATE DATABASE <your_database_name>;
    or you can use phpMyAdmin.
  • Copy the sample configuration file and edit it to match your configuration.
    $ cp .env.example .env
    You'll need to set DB_HOST, DB_DATABASE, DB_USERNAME, and DB_PASSWORD.
  • Run the application by using Artisan commands. Clear cache
    $ php artisan cache:clear
    Generate the APP_KEY
    $ php artisan key:generate
    Run the migrations
    $ php artisan migrate
    Seed fake data
    $ php php artisan db:seed
    Run the application using Artisan
    $ php artisan serve

Swift Project

Install pods using cocoapods.

$ cd TestApi
$ pod install

Open TestApi.xcworkspace file.

Pod Configuration for Swift Project

The swift project has some pods.

Pod name Reference
Alamofire https://github.com/Alamofire/Alamofire
SwiftyJSON https://github.com/SwiftyJSON/SwiftyJSON
Kingfisher https://github.com/onevcat/Kingfisher
SQLite.swift https://github.com/stephencelis/SQLite.swift
SwiftEventBus https://github.com/cesarferreira/SwiftEventBus
MaterialComponents/Snackbar https://material.io/develop/ios/components/snackbars

License

MIT


Free Source Code, Hell Yeah!

Releases

No releases published

Packages

No packages published