Disclaimer: I assume someone has already suggested this and there are good reasons it hasn't happened!
Inspired by a conversation with @pronskiy after my talk "PHP Generics Today (Almost)" at IPC Munich
Examples:
class Queue #
Disclaimer: I assume someone has already suggested this and there are good reasons it hasn't happened!
Inspired by a conversation with @pronskiy after my talk "PHP Generics Today (Almost)" at IPC Munich
Examples:
class Queue #
<div class="tailwind" x-data="{ age: 0, name: '', coppa: false }"> | |
<div class="border rounded-lg my-12 max-w-md"> | |
<div class="p-6"> | |
<h1 | |
class="mt-0" | |
x-show="$wizard.current().title !== ''" | |
x-text="$wizard.current().title" | |
></h1> | |
<?php | |
namespace Tests; | |
use Illuminate\Contracts\Auth\Authenticatable; | |
use Illuminate\Foundation\Http\FormRequest; | |
use Illuminate\Validation\ValidationException; | |
use Illuminate\Validation\Validator; | |
use Symfony\Component\HttpFoundation\ParameterBag; | |
use function PHPUnit\Framework\assertFalse; |
<?php | |
namespace App\Providers; | |
use App\Encrypter; | |
use Illuminate\Support\Str; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ |
The Laravel explination, shown below is confusing.
Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
Many examples use Cache::get('key')
to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.
# Best if added to `after.sh` so that this gets run every time the box is provisioned | |
# Adjust versions as needed; most of this script is forcing php7.2 | |
# composer won't be able to download updates with an active proxy, and will hang trying to get the newest file | |
# You may want to comment this out based on your network configuration | |
sudo bash -c 'echo "export NO_PROXY=*" >> ~/.profile' | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update | |
sudo apt-get install php7.2-dev php7.2-xml mcrypt php-pear php-mbstring unixodbc unixodbc-dev -y --allow-unauthenticated |
# Install Dev Package | |
sudo apt install php7.2-dev | |
# CD Home | |
cd ~ | |
# Get CLI | |
wget -q -O CLI.tar.gz https://iwm.dhe.ibm.com/sdfdl/v2/regs2/smkane/IDSOC/Xa.2/Xb.bL-snMrfTDtX6PgwwuXqAdeiFX6UY09DUuicweVTRlk/Xc.ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz/Xd./Xf.LPr.D1vk/Xg.9810279/Xi.swg-idsoc97/XY.regsrvs/XZ.42v0ODLDocGa6RjgsAKBjJobG6U/ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz | |
# Get PDO | |
wget -q -O PDO.tar.gz https://pecl.php.net/get/PDO_IBM-1.3.5.tgz | |
# Unpack Files & Cleanup | |
tar -zxf CLI.tar.gz |
<?php | |
//Don't forget to change the namespace! | |
namespace App\Traits; | |
use Cron\CronExpression; | |
use Illuminate\Support\Carbon; | |
use Illuminate\Console\Scheduling\ManagesFrequencies; | |
trait Schedulable{ |
#!/bin/sh | |
# If you would like to do some extra provisioning you may | |
# add any commands you wish to this file and they will | |
# be run after the Homestead machine is provisioned. | |
wget https://xdebug.org/files/xdebug-2.5.5.tgz | |
tar xvzf xdebug-2.5.5.tgz | |
cd xdebug-2.5.5 | |
phpize |
<?php | |
class CI_Capstone_Controller extends MY_Controller | |
{ | |
/** | |
* | |
* @param array $header header | |
* @param array $table_data_rows rows | |
* @param string $table_config table bootstrap | |
* @param string $caption_lang caption |