laravel-5.2

Carbon.php The separation symbol could not be found Data missing

帅比萌擦擦* 提交于 2019-12-08 16:37:27
问题 First, I retrieve all the records, //get inventory items $inv = inventory::all(); and then I loop on the retrieved records and modify the created_at and updated_at data to make it more human readable date. foreach($inv as $i){ $i->created_at = date("M d, Y",strtotime($i->created_at)); $i->updated_at = date("M d, Y",strtotime($i->updated_at)); } but it returns me this error, InvalidArgumentException in Carbon.php line 425: Unexpected data found. Unexpected data found. The separation symbol

Laravel 5.2.x disable specific middleware

天大地大妈咪最大 提交于 2019-12-08 16:20:44
问题 Is it possible to disable a specific middleware without disabling all middleware? I will use it when running tests, so I don't want to define middleware groups and then assign them to my routes. $this->withoutMiddleware(); // <-- This will prevent all middleware $this->withoutMiddleware('web'); // <-- What I want is something like this 回答1: I have an alternative solution, you could add a condition in your impacted middleware according to your environnement : public function handle($request,

Language Translation popup is missing on DOM ready in browser: Laravel 5.2

拜拜、爱过 提交于 2019-12-08 15:17:07
问题 I have below code in my controller. public function AllCountries() { $Countries = (new \App\DataAccess\CountryData())->GetAllCountries(); app()->setLocale('fr'); return view('Country.List')->with('Countries', $Countries->getData()->CountryList); } Definition of method to fetch data is below. public function GetAllCountries() { return response()->json(['CountryList' => \App\Models\CountryModel::all()]); } In English language file I have below code. return [ 'CountryName' => "E Country" ]; In

Check more fields in Laravel Auth [closed]

孤者浪人 提交于 2019-12-08 13:54:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am using Laravel 5.2 .In login i wanna Check more field such as is_active while users try to login.How can i do that? thanks. public function up() { Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('first_name', 32)->nullable(); $table->string('last_name', 32)-

Laravel 5.2 Custom validation message with custom validation function

亡梦爱人 提交于 2019-12-08 13:48:35
I want to create custom validation rule with custom validation error message. For this I created a rule: $rule => [ 'app_id' => 'isValidTag' ] And for custom message: $message => [ app_id.isValidTag => 'Not a Valid id' ]; After that I created Service Provider: class CustomValidationServiceProvider extends ServiceProvider { public function boot() { //parent::boot(); $this->app->validator->resolver(function($transator,$data,$rules,$messages){ return new CustomValidator($transator,$data,$rules,$messages); }); } } And my Custom validation class is: class CustomValidator extends Validator { if

ReflectionException in Route.php line 280: Class App\Http\Controllers\classroom does not exist

瘦欲@ 提交于 2019-12-08 13:32:54
问题 Last night i upload my laravel 5.2 project in live server. When i upload this i face this error my classroom controller does not exit. But in localhost it's working nice with no error. My classroom controller : namespace App\Http\Controllers\classroom; //use App\Http\Controllers\controller; use Illuminate\Http\Request; use Illuminate\Support\Facades\Validator; use App\Post; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Auth; use App\Eloquent\Status; use App\Eloquent

Update database value with Bootstrap Modal and Laravel 5.2

烂漫一生 提交于 2019-12-08 13:17:28
问题 I can normally insert, update and delete data from database with Laravel 5.2 . Now i want to update table data with Bootstrap Modal . My modal and Table view in same blade. Modal: <!-- Modal content--> <div class="modal-content"> @foreach($dataQrDetails as $dataQr) <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Updating {{ $dataQr->winner_name }}</h4> </div> <div class="modal-body"> <form class="form-horizontal" role=

How to add watermark image in laravel 5.2 in intervention package?

不想你离开。 提交于 2019-12-08 09:37:34
问题 I am using laravel 5.2 framework and i am using intervention package of laravel that runs fine for me. Now here i face one problem i don't know what i amd doing wrong. Please help:- $myimage = Image::make(storage_path('app/images/test1.jpg')); //Suppose $imyimage width is 3024 and height is 2016 $actualwidth = 3024; $actualheight = 2016; Now, when i tried these sizes 3024 * 2016 pixel then watermark is not visible while when i zoom the image then it is visible Now suppose i have width and

Laravel 5.2 - Every route redirects to the homepage

房东的猫 提交于 2019-12-08 08:59:24
问题 I just started an laravel 5.2 application. Every route I take (/register, /logout, login,...) redirects me to the homepage. Here are my routes <?php Route::group(['middleware' => ['web']], function () { //Register Route::get('/register', 'Auth\AuthController@getRegister'); Route::get('/register/success', 'Auth\AuthController@getRegisterSuccess'); Route::post('/register', 'Auth\AuthController@PostRegister'); //Login Route::get('/login', 'Auth\AuthController@getLogin'); Route::post('/login',

Laravel 5.2 is not reading from .env on ubuntu

▼魔方 西西 提交于 2019-12-08 08:50:29
问题 Note: This question is not a duplicate of these questions: Laravel 5.2 not reading env file Laravel 5.2 .env sometimes doesn't load in time I'm getting this error: production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /home/coder/.local/share/Trash/files/myblog/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45 When I tried dd($config['key']); it returns 'null'. Even the