Skip to content

Instantly share code, notes, and snippets.

@ifirmawan
Created December 6, 2021 06:06
Show Gist options
  • Save ifirmawan/61f00c6ccec89d0bed1fc9dbda2044b6 to your computer and use it in GitHub Desktop.
Save ifirmawan/61f00c6ccec89d0bed1fc9dbda2044b6 to your computer and use it in GitHub Desktop.
Laravel 8 install mix on shared hosting
<?php
namespace App\Providers;
use App\Support\Collection as SupportCollection;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Response::macro('success', function ($value, $code = 200) {
return Response::make([
'status' => 'success',
'data' => $value
], $code);
});
Response::macro('fail', function ($value, $code = 404) {
return Response::make([
'status' => 'fail',
'data' => $value
], $code);
});
$this->app->bind('path.public', function() {
return base_path().'/../public_html';
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment