This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Make sure that we get an array from JSON string | |
* | |
* @param $value | |
* @return array | |
*/ | |
public function getSettingsAttribute($value) { | |
return json_decode($value, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Hash; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* Class Member | |
* @package App | |
*/ | |
class Member extends Model | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('members', function() { | |
$user = App\Member::create([ | |
'first_name' => 'saeed', | |
'last_name' => 'nasiri', | |
'email' => 'saeed.nasiri@gmail.com', | |
'password' => '!supersecretpassword!', | |
'last_login' => Carbon\Carbon::now(), | |
'settings' => ['two_factor_aut' => true, 'session_time' => 1200], | |
'created_at' => Carbon\Carbon::now(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateContactsTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Controllers; | |
use App\Contact; | |
use Response; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use Illuminate\Http\Request; | |
class ContactController extends Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layout') | |
@section('content') | |
<div class="col-md-12"> | |
<div class="table-responsive"> | |
<table class="table table-bordered table-condensed table-striped"> | |
<thead> | |
<th>ID</th> | |
<th>NAME</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layout') | |
@section('content') | |
{!! Form::open(['action' =>'ContactController@store', 'method' => 'POST','files'=>true])!!} | |
<div class="col-md-6"> | |
<div class="form-group required"> | |
{!! Form::label("NAME") !!} | |
{!! Form::text("name", null ,["class"=>"form-control","required"=>"required"]) !!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layout') | |
@section('content') | |
{!! Form::open(['action' =>['ContactController@update',$data->id], 'method' => 'PUT','files'=>true])!!} | |
<div class="col-md-6"> | |
<div class="form-group required"> | |
{!! Form::label("NAME") !!} | |
{!! Form::text("name", $data->name ,["class"=>"form-control","required"=>"required"]) !!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\User; | |
class UserController extends Controller | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends($theme) | |
@section('content') | |
<table class="table table-bordered"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th width="300px;">Action</th> | |
</tr> |