How to change primary-color of webpack for laravel? - laravel-backpack

A customer, sigh, asked to change buttons to standard 'boostrap blue' color.
Could you point me to a guide on which file change and how to recompile theme?
Or tell me if there is a way to override compiled theme without do bad things?

You can follow this section in the Backpack 4.2 docs to do that. The same also works for Backpack 4.1.
In short, in your config/backpack/base.php, under styles you should stop using the standard bundle file and use the blue bundle instead:
'styles' => [
- 'packages/backpack/base/css/bundle.css',
+ 'packages/backpack/base/css/blue-bundle.css',
Make sure you're running Backpack 4.1.57+ for that blue-bundle.css file to exist. If it still doesn't, re-publish the assets using php artisan vendor:publish --provider="Backpack\CRUD\BackpackServiceProvider" --tag=public --force

Related

Call to a member function getDateFormat() on null, laravel/passport install

I am getting a
[Symfony\Component\Debug\Exception\FatalThrowableError] Call to a member function getDateFormat() on null
when running "php artisan passport:install" on a laravel/mongodb api project. I have tried changing "use Illuminate\Database\Eloquent\Model;" to "use Jenssegers\Mongodb\Eloquent\Model as Model;" in my user and client.php but it still throws the exception.
any ideas??
I also encountered this problem while developing a same type of project. This occurs because Laravel Passport doesn't support Jenssegres\laravel-mongodb. It uses the Illuminate\Database\Eloquent\Model by default.
Now there are two solutions to this.
You can go on changing every Illuminate\Database\Eloquent\Model to Jenssegres\Mongodb\Eloquent\Model in the Laravel Passport's vendor folder(there are about 6 files you will have to change), but this is not recommended, as when you will try you push this project on the production server, the vendor folder is ignored, and you will have to do all the changes again. Also if they change something and you update it, all the changes will be lost.
Another way of doing this, which I would recommend is, using designmynight/laravel-mongodb-passport package. This package will do the above-stated things and will do it efficiently. Installation is also pretty simple. You can go through the documentation here and you can have it up and running in no time.
Hope this can solve your problem.
Documentation link: https://github.com/designmynight/laravel-mongodb-passport

How to auto-load everything in a custom library folder in ZF2?

I have been looking for a solution for this for days and nothing I have tried worked so far :(
We want, in addition to the vendor folder, to have a lib folder where to store own libraries which shouldn't be managed by composer. All namespaces/classes should be automatically loaded.
We don't want to make modules out of these libraries, as they are unrelated to the display (we have a database library, for example).
I have tried:
application.config.php:
'module_listener_options' => [
'module_paths' => [
'./module',
'./vendor',
'./lib'
],
...
]
But doesn't work... Is what we want even possible? Or is it correct but needs more steps to work? I have found plenty of information on how to load a single class/library that is inside the vendor, but none on how to add a autoload path to autoload everything from a directory outside vendor.
Those libraries we have right now in vendor, the problem we have is that we modify the files regularly and every time we want to run composer, he wants to override all our changes...
What is the correct way to deal with this situation?
Any advice/info would be super helpful!!!
Gioia
You must add in your root/autoloader.php a statement to load your library. Eventually you have to write a autoload.php at the root of your library.

Using MEAN.IO how will my package's assets get aggregated?

I'm not an experienced Javascript application developer, however, I've recently been learning some MEAN using http://mean.io/#!/ as my scaffolding.
I can see that the out of the box assets are listed in:
/server/config/assets.json
and when the app is running the referenced assets get combined into client side files:
/modules/aggregated.css
/modules/aggregated.js
When I create a package using MEAN.IO's CLI:
mean package myPackage;
and start including css or scripts in this package, presumably it is bad practice to then put the packages assets into the application's assets.json as these packages are supposed to be reusable modules that could be added to someone else's MEAN application.
What's the right place to reference the new package's assets so that they are added into the aggregration process?
you want to add css or js files into your packages.
If so, it's easy. As the doc says in "Assets and Aggregation" http://learn.mean.io/#mean-packages-assets-and-aggregation
you should use
//Adding another library - global by default is false
MyPackage.aggregateAsset('js','jquery.min.js', {global:true});
//Adding some css to the mean project
MyPackage.aggregateAsset('css','default.css');

Zend/Controller/Action.php file missing

I'm new to Zend framework, and was trying out the Guestbook tutorial that Zend has on it's web site. I have the latest framework downloaded and setup properly; php.ini include_files has the library location set correctly. In the Guestbook tutorial, the GuestbookController extends Zend_Controller_Action and that's what I typed, but I keep getting error stating that Zend_Controller_Action is not found. Turns out, the folder Controller is missing from /library/Zend. I tried re-downloading Zend Framework thinking I might have accidentally deleted it, but it's not in the newly downloaded framework directory either. So, where can I get the Controller folder that contains all the required class files? Or how can I fix the issue? Any help is much appreciated.
Thanks
Kuni
It sounds like the tutorial you are following is for ZF1. ZF2 was released last year and works quite differently. You might want to try the quickstart from the current manual instead:
http://framework.zend.com/manual/2.0/en/user-guide/overview.html
Alternatively you can still download version 1.12 from the Zend site.

How to use omnigroup framework in an iOS project?

I need to be able to write and read from a rtf file in iOS.
The omnigroup framework has the 2 classes i am looking for :
OmniUI/iPad/RTF/OUIRTFReader
OmniUI/iPad/RTF/OUIRTFWriter
I managed to build the frameworks but i cant figure out how to integrate theses classes in my own project.
I had the following frameworks to my project :
OmniAppKit.framework
OmniFoundation.framework
OmniBase.framework
I still get some undefined identifier such as :
RCS_ID("$Id$");
OBINITIALIZE
OMNI_POOL_START
Has anybody been able to use the omnigroup framework in your own project ?
Thanks,
Vincent
We do need some better documentation for this, but the TextEditor example app in OmniUI/iPad/Examples/TextEditor may be a good starting point for seeing how we include the frameworks in our apps.
In this particular case, you may prefer to pull out the OUIRTFReader class and any dependencies it needs from OmniAppKit and OmniFoundation into your project. updating the #imports to be "..." instead of <OmniThis/AndOmniThat.h>.
Perhaps you could try following the instructions given as part of this thread on the Omni Group forums. They appear to have been able to build the framework under the iOS 4.2 SDK.
I don't think you want the OmniAppKit framework, as that is just for the Mac.