项目作者: topdev115

项目描述 :
The Swift App Sample with Laravel RESTful API
高级语言: PHP
项目地址: git://github.com/topdev115/Laravel-Swift-Sample.git
创建时间: 2019-11-13T04:40:25Z
项目社区:https://github.com/topdev115/Laravel-Swift-Sample

开源协议:MIT License

下载


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.

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

Laravel Project

  • Install the application’s dependencies with Composer
    1. $ cd ApiServer
    2. $ composer install
  • Create a new database for project. (MySQL).
    You can use Terminal like this
    1. mysql -u root -p
    2. mysql> CREATE DATABASE <your_database_name>;
    or you can use phpMyAdmin.
  • Copy the sample configuration file and edit it to match your configuration.
    1. $ 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

    1. $ php artisan cache:clear

    Generate the APP_KEY

    1. $ php artisan key:generate

    Run the migrations

    1. $ php artisan migrate

    Seed fake data

    1. $ php php artisan db:seed

    Run the application using Artisan

    1. $ 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!