mercredi 31 janvier 2018

Laravel Route URI: Add or condition

I have written a route with uri, which accepts /app/12/password

Route::get('app/{id}/password', 'AppController@pwd')->name('apwd');

Now i want to extend it to also accept /app/12/pwd. What is standard way to do this, since i can't write different route. I tried.

Route::get('app/{id}/(pwd|password)', 'AppController@pwd')->name('apwd');

Any help is appreciated.



via Chebli Mohamed

mardi 30 janvier 2018

Laravel 5.1 Snappy problems with Authentication

I am using Barrydvh\Snappy for PDF generation on my Laravel 5.1 application. The PDF must be generated once the user has logged in, as that view must be kept private.

It seems that the shell opened by wkhtmltopdf creates a parallel session, therefore there is no user authenticated, and I get back the login route instead of the desired private view.

Does anyone know how to handle this?

Thank you all in advance.

Best regards, Marta



via Chebli Mohamed

Laravel 5.1 application setup with existing source code

Am trying to setup laravel application, but it is displaying only laravel default page. not able to run the application.
i have followed below steps. 1)dump the code in xamp\htdocs\sample(application folder name) and updated db details in command prompt 2) composer update 3)php artisan up 4)php artisan serve

after serve command it is displaying as "Laravel development server started on http://localhost:8000/

[Tue Jan 30 14:58:23 2018] ::1:51377 [200]: /favicon.ico
[Tue Jan 30 14:58:26 2018] ::1:51380 [200]: /favicon.ico
[Tue Jan 30 14:59:51 2018] ::1:51384 [200]: /favicon.ico

in browser http://localhost:8000/ displaying laravel defaule page. please let me know how to setup the application and if i miss anything in above steps. thanks in advance.



via Chebli Mohamed

dimanche 28 janvier 2018

Laravel view don't update after adjusting time

I am creating password expiration (90 days) in laravel, then I adjust my current date and put it to 90 days (when changing view its still updating), after test I back my current date and update some view but view is not updating anymore. My Procedure:

Step 1: Go to your laravel project

Step 2: change computer time (ex: if 1/29/2018 now, change it to 7/29/2018)

Step 3: edit your laravel project, check if your view is updating (if yes proceed to step 4 )

Step 4: back your current date, then update your code in view again, its not updating anymore

I am using IIS as my server, laravel 5.1, php 5.5.

I already try to use this.

composer dump_autoload

composer clear-cache

php artisan clear-compiled

php artisan config:clear

php artisan cache:clear

I also try to clear browsing data

Sorry for but English its not my major language.

Thanks a lot.



via Chebli Mohamed

vendredi 26 janvier 2018

BadMethodExcption in Laravel Controller

I created a controller in Laravel but when I call a method from Controller it shows the following error

BadMethodCallException
Method [Register] does not exist on [App\Http\Controllers\UserController].

Thanks,

Aisha Zafar



via Chebli Mohamed

mercredi 24 janvier 2018

Sphinx indexer does not fetch data when MySQL transaction is used

please help me with running phpunit tests that check module with sphinx search engine.

To search in that module I use two sphinx indexes docs and docsdelta. After new data are appear in the DB, I do following:

exec("indexer docsdelta --rotate");
exec("indexer --merge docs docsdelta --rotate");

It works well on my website and I am able to add new document through the web interface and it appears in the search.

On the same time when I run phpunit test and it creates new document "on fly",

exec("indexer docsdelta --rotate");

does not fetch any new data. My phpunit tests use transactions to rollback the database to the previous state and I notice, that indexer works properly in case if I switch off transactions. Additionally I am able to see new data in the DB, just before and after running indexer. Maybe I missed something but I do not understand why transaction has an influence on indexer.

Is it some way to use indexer docdelta together with MySQL transaction?

Thank you in advance for help!



via Chebli Mohamed

jeudi 18 janvier 2018

With chrisbjr/api-guard how do I turn off it auth for a subset of routes

Under Laravel 5.1

How do I turn off api-guard for certain routes and turn it on for others. We're building an app that needs REST API as well as standard web stuff.

We'd like mobile users to be able to log in and get their auth key, then use that for subsequent auth'd calls. Non mobile users to utilize the Laravel auth that comes out of the box.



via Chebli Mohamed