Download the PHP package simaocoutinho/admin without Composer

On this page you can find all versions of the php package simaocoutinho/admin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package admin

Latest Stable Version License

Instalation

Install Jetstream

Follow link: https://jetstream.laravel.com/2.x/installation.html

Install LaravelDebugbar

composer require barryvdh/laravel-debugbar --dev

Install AdminStarterCode

composer require simaocoutinho/admin

Publish Public Assets
Assets that will change according the project

php artisan vendor:publish --tag="admin-public"

Publish Views

php artisan vendor:publish --tag="admin-views" --force

In file: config/filesystem.php
Replace:

'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

by:

'public' => [
            'driver' => 'local',
            'root' => public_path('uploads'),
            'url' => env('APP_URL').'/uploads',
            'visibility' => 'public',
        ],

Debug Only for developer

In file: config/app.php
Replace:

    'debug' => (bool) env('APP_DEBUG', false),

by:

    'debug' => value(function() {
        if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] == 'IP')
            return true;

        return false;
    }),

Override Redirect on PageExpired

In file: app/Exceptions/Handler.php

Add:

    public function register()
    {
        ...

        $this->renderable(function (\Exception $e) {
            if ($e->getPrevious() instanceof \Illuminate\Session\TokenMismatchException) {
                return redirect()->route('login');
            };
        });
    }

Override Login & Register Redirect

Link: https://laravel-news.com/override-login-redirects-in-jetstream-fortify

Create: app/Http/Responses/LoginResponse.class

Copy:

namespace App\Http\Responses;

use Auth;
use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;

class LoginResponse implements LoginResponseContract
{
    /**
     * @param  $request
     * @return mixed
     */
    public function toResponse($request)
    {
        if (Auth::user()->type == 'client') {
            return redirect()->route('home');
        } else {
            return  redirect()->route('dashboard');
        }
    }
}

Create: app/Http/Responses/RegisterResponse.class

Copy:

namespace App\Http\Responses;

use Auth;
use Laravel\Fortify\Contracts\RegisterResponse as RegisterResponseContract;

class RegisterResponse implements RegisterResponseContract
{

    public function toResponse($request)
    {
        if (Auth::user()->type == 'client') {
            return redirect()->route('home');
        } else {
            return  redirect()->route('dashboard');
        }
    }
}

In file: FortifyServiceProvider.class

Add:

use App\Http\Responses\LoginResponse;
use App\Http\Responses\RegisterResponse;
use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;
use Laravel\Fortify\Contracts\RegisterResponse as RegisterResponseContract;
use Laravel\Fortify\Contracts\TwoFactorLoginResponse as TwoFactorLoginResponseContract;

public function boot()
{
    // ...

    $this->app->singleton(LoginResponseContract::class, LoginResponse::class);
    $this->app->singleton(RegisterResponseContract::class, RegisterResponse::class);
    $this->app->singleton(TwoFactorLoginResponseContract::class, LoginResponse::class);
}

Check if user is active on login

In file: app/Providers/JetstreamServiceProvider.php

Add:

public function boot()
    {
        ...

        // Verifica se o user está ativo
        Fortify::authenticateUsing(function (Request $request) {
            $user = User::where('email', $request->email)->first();

            if ($user && Hash::check($request->password, $user->password)) {
                if ($user->state == 1) {
                    return $user;
                }
            }

            return null;
        });
    }

Force HTTPS via htaccess

# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

All versions of admin with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package simaocoutinho/admin contains the following files

Loading the files please wait ....