Simple just type
php -a
More info about php :
Example : for SQLITE the double quote is critical to make it work
Polls::updateOrInsert(['business_id'=> $business_id],
[
"$vote_value" => DB::raw('"$vote_value" + 1'),
'polls_name' => $theBusiness->BUSINESSNAME,
'source' => env('APP_CODE'),
'updated_at' => $lastupdated
]);
'ilike' or 'not ilike'
return $query->where('api_call', 'not ilike', '%TEST%');
#1 – Install Flag library via NPM
npm install flag-icon-css
#2 – Import css to your library
import 'flag-icon-css/css/flag-icon.css'
#3 – in your blade
<li > <a href="/en"> <i class=" flag-icon flag-icon-us"></i></a> </li>
use this command php artisan migrate --path=/database/migrations/my_migration.php
Â
php artisan nova:resource Businesses php artisan make:model Businesses
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Thetable extends Model { protected $connection = 'pgsql-api'; protected $table = 'mapi_admin_tool.THETABLE'; protected $primaryKey = 'id'; protected $dateFormat = 'Y-m-d H:i:sO'; public function __construct(array $attributes = []) { parent::__construct($attributes); } protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; }
<?php namespace App\Nova; use Illuminate\Http\Request; use Laravel\Nova\Fields\Date; use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Text; use Laravel\Nova\Http\Requests\NovaRequest; class Thetable extends Resource { /** * The model the resource corresponds to. * * @var string */ public static $model = 'App\M2TrackFileSubmissionToWindsurfer'; /** * The single value that should be used to represent the resource when being displayed. * * @var string */ public static $title = 'id'; /** * The columns that should be searched. * * @var array */ public static $search = [ 'id', ]; /** * Get the fields displayed by the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function fields(Request $request) { return [ ID::make('id')->sortable(), Text::make('file_uuid')->sortable(), Text::make('set_uuid')->sortable(), Text::make('windsurfer_job_id')->sortable(), Text::make('cust_filename')->sortable(), Text::make('artwork_info')->sortable(), Date::make('created_at')->sortable(), Date::make('update_at')->sortable(), ]; }
Laravel – Versionning your app.js to cache bust for deploying
1 – Modify following file webpack.mix.js
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css').version();
mix.version();
2 – Modify your blade
<script src="{{ env('APP_URL') }}{{ mix('js/app.js') }}"></script>
3 – you will see the following generation
<script src="https://xxxxx.raleche.com.test/js/app.js?id=a8305a8c81a6359c3c7b"></script>
php artisan make:model --migration --controller ContactForm
public function up() { Schema::create('contact_forms', function (Blueprint $table) { $table->id(); $table->text('name'); $table->text('email'); $table->text('subject'); $table->longText('Message'); $table->timestamps(); }); }
php artisan migrate
Route::post('/contactform', 'ContactFormController@store' );
/** * Laravel basic verification of the field email */ $this->validate($request, [ 'email' => 'required|email', ]); /** * Create new record in teh database */ $contactForm = ContactForm::firstOrCreate([ 'email' => request('email'), 'name' => request('name'), 'message' => request('message'), 'subject' => request('subject'), ]); if (request()->wantsJson()) { Mail::to('davidraleche@gmail.com', request('contactform')) ->send(new \App\Mail\ContactForm($request)); return response('Success Form has been Sent', 201); } /** * Redirect to the successful page creation */ return redirect('/')->with('flash', 'Success You subscribed to our Newsletter ');
php artisan make:mail ContactForm --markdown=emails.contactform
#1 – Make sure the composer.json looks like this
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^8.0",
"laravel/passport": "^10.0",
"laravel/socialite": "^5.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
"predis/predis": "^1.1"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9"
}
#2 – if you see following issue
laravel/framework replaces illuminate/support and thus cannot coexist with it.
Remove remove illuminate/support
composer remove illuminate/support
#3 – The report, render, shouldReport, and renderForConsole methods of your application’s App\Exceptions\Handler class should accept instances of the Throwable interface instead of Exception instances: Change app/Exceptions/Handler.php as follow
<?php
namespace App\Exceptions;
use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param \Throwable $exception
* @return void
*/
public function report(Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
}
php artisan config:clear
php artisan key:generate
php artisan config:clear
Laravel Socialite makes the experience painless and fast to implement. I highly recommend this package for quick development ! Here