This file contains hidden or 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 Tests\Concerns; | |
use App\Models\User; | |
use Tymon\JWTAuth\Facades\JWTAuth; | |
trait AttachJwtToken | |
{ | |
/** |
This file contains hidden or 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\Filters; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Http\Request; | |
abstract class QueryFilter | |
{ | |
/** |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
if (!isset($argv[1])) { | |
echo_error("Please, tell me what PHP version you want!"); | |
exit; | |
} | |
$to_version = $argv[1]; | |
$to_version = (int)str_replace('.', '', $to_version); |
This file contains hidden or 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 | |
// set your model file and tell it the connection name you're using in config/database.php | |
// file: app/Post.php | |
namespace App; | |
use Corcel\Post as Corcel; | |
class Post extends Corcel |
This file contains hidden or 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 Corcel\Post as Corcel; | |
class Service extends Corcel | |
{ | |
protected $postType = 'service'; | |
} |
This file contains hidden or 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 | |
$post = Post::find(1); | |
$avatar = $post->meta->avatar; | |
$phone = $post->meta->phone; |
This file contains hidden or 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 // File: /app/Http/Controllers/AnyController.php | |
// ... | |
public function index() | |
{ | |
$posts = Post::published()->take(10)->get(); | |
$page = Page::where('post_name', 'about')->first(); | |
return view('posts.index', compact('posts', 'page')); |
This file contains hidden or 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 // File: /config/database.php | |
'connections' => [ | |
'mysql' => [ | |
'driver' => 'mysql', | |
'host' => 'localhost', | |
'database' => 'app', | |
'username' => 'admin' | |
'password' => 'secret', |
This file contains hidden or 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 // File location: /wp-content/themes/my-theme/src/Models/ | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model as Eloquent; | |
class Car extends Eloquent | |
{ | |
protected $table = 'cars'; | |
protected $primaryId = 'id'; |
This file contains hidden or 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
Verifying that +jgrossi is my blockchain ID. https://onename.com/jgrossi |
NewerOlder