ok so lets start off with code
return [
'name' => $this->name,
'user_display_name' => $this->user_display_name,
'user_city' => $this->user_city,
'user_region' => $this->user_region,
'user_country' => $this->user_country,
'profile_photo_path' => $this->profile_photo_path,
'_geo' => [
'lat' => $this->user_latitude,
'lon' => $this->user_longitude,
],
];
So, the issue is, when I do php artisan scout:import "App\Models\User" it gets all the data except inside the _geo array. I have looked at the formatting 100 times but it looks right based on all the docs and everything. Does anyone have any idea what I am not seeing?
We have several Laravel applications that use Backpack for the admin panel. A developer wrote a package that used Single sign-on. We have removed this package as it was not working correctly. Once Composer was used to updating Laravel and remove the package, there are NO routes to deal with admin login. Our applications use Laravel 5.8/6 and Backpack 3.6/4.0.
I created another test application with Laravel 5.8 using Backpack 3.6, and the routes are available for login. As you can see, all the login routes are available.
If you look at the following image, you can see the login routes are all missing.
Is there a way to add the routes in again? Laravel Backpack is still installed, but I need to re-register the routes.
All the settings in the application are set to default. I have even made the default authentication guard in config/auth.php to Backpack.
config/auth.php
'defaults' => [
'guard' => 'backpack',
'passwords' => 'users',
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
],
config/backpack/base.php
'route_prefix' => 'admin',
'setup_auth_routes' => false,
'setup_dashboard_routes' => true,
'setup_my_account_routes' => true,
'user_model_fqn' => App\Models\BackpackUser::class,
'middleware_class' => [
App\Http\Middleware\CheckIfAdmin::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
// \Backpack\Base\app\Http\Middleware\UseBackpackAuthGuardInsteadOfDefaultAuthGuard::class,
],
// Alias for that middleware
'middleware_key' => 'admin',
'authentication_column' => 'email',
'authentication_column_name' => 'Email',
'guard' => 'backpack',
'passwords' => 'backpack',
config/backpack/permissionmanager.php
'models' => [
'user' => App\Models\BackpackUser::class,
'permission' => Backpack\PermissionManager\app\Models\Permission::class,
'role' => Backpack\PermissionManager\app\Models\Role::class,
],
'allow_permission_create' => false,
'allow_permission_update' => false,
'allow_permission_delete' => false,
'allow_role_create' => true,
'allow_role_update' => true,
'allow_role_delete' => true,
'multiple_guards' => true,
app/Models/BackpackUser.php
class BackpackUser extends User
{
use CrudTrait;
use HasRoles;
use InheritsRelationsFromParentModel;
protected $table = 'users';
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
public function getEmailForPasswordReset()
{
return $this->email;
}
}
So pretty much standard settings. I cannot figure out why the routes are not registered and available. If you get to http://localhost/admin, I get redirected to http://localhost/admin/login, which gives a 404 error. Can anyone help?
You have to enable 'setup_auth_routes' => true in config/base.php. This will allow Backpack to use the standard routes. Then the second step is to use Auth::routes(); inside your routes/web.php
If you are missing some/all of the controllers or UIs then you can scaffold them:
Install laravel/ui part using composer require laravel/ui
Use php artisan ui vue --auth or php artisan ui bootstrap --auth or php artisan ui react --auth depending on what you use for the front-end.
I want to integrated smartystreets with my laravel project but am not able to do so.
I have tried this link , but it throw me error "Undefined constant 'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider'" when i run "$ php artisan vendor:publish".
Any help would be appreciated.`
Change in step 2 of the above link worked for me:
change this:
'providers' => array(
...
'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider',
)
'aliases' => array(
...
'SmartyStreets' => 'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsFacade',
)
to this:
'providers' => [
...
FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider::class,
],
'aliases' => [
...
'SmartyStreets' = > FireEngineRed\SmartyStreetsLaravel\SmartyStreetsFacade::class,
],
Note:Add the SmartyStreets providers and aliases element at the end of the both array.
Using datatables in laravel 5 as:
return Datatables::of($email_details)
->filterColumn('from_name', 'from_lname', 'subject', 'date')
->make(true);
My data is like that:
ABC XYZ subject1 22-02-2016
abc XYZ subject1 22-02-2016
FFF XYZ subject1 22-02-2016
when I am going to filter : abc , it exactly matches.
I want two records : ABC, abc.
is there changes in JS?
I had exactly the same problem and figured it out by debugging the code.
What I did to solve the issue:
browse to {laravelProjectDir}\vendor\yajra\laravel-datatables-oracle\src\config\
copy the file config.php to your {laravelProjectDir}\config folder
rename the file to datatables.php
Since the configuration is already as you need it (case_insensitive => true) there is no more to do. The configuration just does not seem to work when in vendor folder.
The last hint I needed to solve it, I found here:
https://github.com/yajra/laravel-datatables/issues/612
Edit - 13 Aug. 2017
A more elegant way to get vendor configuration files into your project is by using the corresponding artisan command:
php artisan vendor:publish --tag="config"
Just create php file name "datatables.php" on config folder of laravel and paste below code. its working. Thanks
return [
'search' => [
'smart' => true,
'case_insensitive' => true,
'use_wildcards' => false,
],
'fractal' => [
'includes' => 'include',
'serializer' => 'League\Fractal\Serializer\DataArraySerializer',
],
'script_template' => 'datatables::script',
'index_column' => 'DT_Row_Index',
'namespace' => [
'base' => 'DataTables',
'model' => '',
],
'pdf_generator' => 'excel',
'snappy' => [
'options' => [
'no-outline' => true,
'margin-left' => '0',
'margin-right' => '0',
'margin-top' => '10mm',
'margin-bottom' => '10mm',
],
'orientation' => 'landscape',
],
];
This could be a very late reply but running this command in your project root directory does the magic
php artisan vendor:publish --tag="config"
I'm trying to add the HtmlServiceProvider with Laravel 5.
I keep getting the following error:
FatalErrorException in compiled.php line 6391:
Class 'Illuminate\Html\HtmlServiceProvider' not found
This is how my providers look like:
'providers' => [
/*
* Laravel Framework Service Providers...
*/
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
'Illuminate\Foundation\Providers\FoundationServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Auth\Passwords\PasswordResetServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
/*
* Application Service Providers...
*/
'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',
],
This is how my aliases look ik app.php:
'aliases' => [
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Bus' => 'Illuminate\Support\Facades\Bus',
'Cache' => 'Illuminate\Support\Facades\Cache',
'Config' => 'Illuminate\Support\Facades\Config',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Hash' => 'Illuminate\Support\Facades\Hash',
'Input' => 'Illuminate\Support\Facades\Input',
'Inspiring' => 'Illuminate\Foundation\Inspiring',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',
],
At last i have added this inside my composer.json
"require": {
"laravel/framework": "5.0.*",
"illuminate/html": "~5.0"
},
Somehow i keep getting this error so im hoping someone can help me out with this :)
Thanks in advance!
First add this line to composer.json
"illuminate/html": "~5.0"
Then do a composer update
Wait for the update to finish, then open config/app.php add this:
'Illuminate\Html\HtmlServiceProvider',
to the providers array and this:
'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',
to the aliases array, and be sure when you use Html in blade or wherever use it in lowercase 'Html' not HTML
Here is a reference link: http://thegeekyland.blogspot.com/2015/11/class-illuminatehtmlhtmlserviceprovider.html
Illuminate\Html\HtmlServiceProvider is not a core element anymore. Laravel components that have been removed from the core framework are available on laravelcollective.com your html & forms components can be found here:
http://laravelcollective.com/docs/5.0/html
add this to your composer.json :
"laravelcollective/html": "~5.0"
then update composer:
composer update
then add providers in config/app.php
'Collective\Html\HtmlServiceProvider',
and finally add two aliases in the same file:
'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',
Illuminate/HTML package has been deprecated
Use:laravelcollective/html
https://stackoverflow.com/a/34991188/3327198
composer require laravelcollective/html
Add this lines in config/app.php
in providers group:
Collective\Html\HtmlServiceProvider::class,
in aliases group:
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
Try the following steps
Edit your project's composer.json file.
"require": {
"laravelcollective/html": "~5.0"
}
Next, update Composer from the Terminal:
composer update
Next, add your new provider to the providers array of config/app.php:
'providers' => [
// ...
'Collective\Html\HtmlServiceProvider',
// ...
],
Finally, add two class aliases to the aliases array of config/app.php:
'aliases' => [
// ...
'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',
// ...
],
Me I found another cause for this issue:
in ../Vendor directory sometimes there is a file called "config.php", either delete that file completely or find in there some thing like
this line:
array (
...
28 => 'Illuminate\Html\HtmlServiceProvider',
...
),
, and remove the line, and then do the "composer update" command, this will help. (It helped me too).
You can also use like this
Illuminate\Html\HtmlServiceProvider::class, and
'Form' => Illuminate\Html\FormFacade::class,
'Html' => Illuminate\Html\HtmlFacade::class,
The error indicates it can't find the service provider so make sure you do a composer update. If you did do a composer update check your vendor folder to make sure it pulled in the dependency.
Double check when Updating your composer, whether you're in the right directory
Run this in cmd
php artisan Illuminate\Html
and then add variables in app.php
You can follow below link of Laravel documentation there you can find the solution for all version or Laravel i.e 5.0, 5.1, 5.2, 5.3
https://laravelcollective.com/docs/5.3/html
For use laravel html helper you need to require dependency in composer.json file and use namespance.For full process follow my blog.
http://www.kingpabel.com/laravel-html-helper/