Skip to content

Instantly share code, notes, and snippets.

View earth774's full-sized avatar
🐷
Wannueng

เอิร์ท earth774

🐷
Wannueng
View GitHub Profile
@earth774
earth774 / UserController.php
Created March 9, 2019 08:20
UserController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Response;
class UserController extends Controller
{
/**
* Create a new controller for User.
@earth774
earth774 / web.php
Created March 9, 2019 08:53
route lumen
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
@earth774
earth774 / .env
Created March 9, 2019 09:52
create file .env
APP_NAME=Lumen
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=UTC
LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=
@earth774
earth774 / database.php
Created March 9, 2019 11:30
config database
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
@earth774
earth774 / User.php
Created March 9, 2019 12:05
create model User.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
/**
@earth774
earth774 / UserController.php
Created March 9, 2019 12:15
add get all in userController
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Response;
class UserController extends Controller
{
/**
@earth774
earth774 / UserController.php
Created March 9, 2019 12:15
add get all in userController
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Response;
class UserController extends Controller
{
/**
@earth774
earth774 / UserController.php
Created March 9, 2019 12:45
add addData in UserController.php
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class UserController extends Controller
{
@earth774
earth774 / CorsMiddleware.php
Created March 9, 2019 13:23
Create file CorsMiddleware.php allow origin
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace App\Http\Middleware;
@earth774
earth774 / Create_users_table.php
Last active March 10, 2019 13:49
file migration create user
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.