- GET Requests
- POST/PUT Requests
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 | |
function setActive($path, $active = 'active'){ | |
return call_user_func_array('Request::is', (array) $path) ? $active : ''; | |
} |
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
#include "stdio.h" | |
#include "iostream" | |
using namespace std; | |
int main() | |
{ | |
int luas = 0, panjang = 0, lebar = 0; | |
printf("%s" "\n", "Calculate the area of a rectangle"); |
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 | |
// our php array for example, if you using data from database, make it | |
$array = [ | |
252, 124, 40, 29, 1 | |
]; | |
// stars, 1 - 5 | |
$star = [ | |
5, 4, 3, 2, 1 |
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\Repositories; | |
interface PostRepositoryInterface { | |
public function all(); | |
public function take(int $limit); |
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\Repositories\Eloquent; | |
use App\Repositories\Eloquent\Entities\Post; | |
use App\Repositories\PostRepositoryInterface as PostInterface; | |
class PostEloquent implements PostInterface | |
{ | |
protected $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 | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CreatePostsTable extends Migration | |
{ | |
//... | |
public function up() |
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\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class RepositoryServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register services. |
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\Requests; | |
use Illuminate\Support\Str; | |
use Illuminate\Foundation\Http\FormRequest; | |
class PostRequestValidate extends FormRequest | |
{ | |
/** |
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\Http\Requests\PostRequestValidate; | |
use App\Repositories\PostRepositoryInterface as PostEloquent; | |
class PostController extends Controller |
OlderNewer