PHP code example of the-3labs-team / nova-redirector-seo
1. Go to this page and download the library: Download the-3labs-team/nova-redirector-seo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
the-3labs-team / nova-redirector-seo example snippets
return [
'cache' => [
'ttl' => 60 * 60 * 24 * 7, // 7 days
],
];
/**
* Register the application's Nova resources.
*
* @return void
*/
protected function resources()
{
Nova::resourcesIn(app_path('Nova'));
Nova::resources([
\The3LabsTeam\NovaRedirectorSeo\App\Nova\NovaRedirectorSeo::class,
]);
}
protected $middleware = [
\The3LabsTeam\NovaRedirectorSeo\App\Http\Middleware\NovaRedirectorSeoMiddleware::class,
//...
protected $policies = [
'The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo' => 'App\Policies\NovaRedirectorSeoPolicy',
];
namespace App\Policies;
use App\Models\User;
use The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo;
use Illuminate\Auth\Access\HandlesAuthorization;
class NovaRedirectorSeoPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*
* @param \App\Models\User $user
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny(User $user)
{
return true;
}
/**
* Determine whether the user can view the model.
*
* @param \App\Models\User $user
* @param The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo $novaRedirectorSeo
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view(User $user, NovaRedirectorSeo $novaRedirectorSeo)
{
return true;
}
/**
* Determine whether the user can create models.
*
* @param \App\Models\User $user
* @param The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo $novaRedirectorSeo
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create(User $user)
{
return false;
}
/**
* Determine whether the user can update the model.
*
* @param \App\Models\User $user
* @param The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo $novaRedirectorSeo
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update(User $user, NovaRedirectorSeo $novaRedirectorSeo)
{
return false;
}
/**
* Determine whether the user can delete the model.
*
* @param \App\Models\User $user
* @param The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo $novaRedirectorSeo
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete(User $user, NovaRedirectorSeo $novaRedirectorSeo)
{
return false;
}
/**
* Determine whether the user can restore the model.
*
* @param \App\Models\User $user
* @param The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo $novaRedirectorSeo
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore(User $user, NovaRedirectorSeo $novaRedirectorSeo)
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*
* @param \App\Models\User $user
* @param The3LabsTeam\NovaRedirectorSeo\App\Models\NovaRedirectorSeo $novaRedirectorSeo
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete(User $user, NovaRedirectorSeo $novaRedirectorSeo)
{
return false;
}
}
bash
php artisan vendor:publish --tag="nova-redirector-seo-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="nova-redirector-seo-config"
bash
php artisan make:policy NovaRedirectorSeoPolicy