laravel-5.2

Get data from array of array object in laravel

纵然是瞬间 提交于 2019-12-25 08:49:39
问题 I have this data: [{"order_id":37,"order_code":"Order00003","user_id":1,"full_name":"Duc.VUong","phone":"01203388870","address":"445\/33b b\u00ecnh \u0111\u00f4ng","recieve_address":"445\/33b b\u00ecnh \u0111\u00f4ng","total_product":2,"total_price":1450000,"status":0,"created_at":"2017-04-12 17:01:38","updated_at":"2017-04-12 17:01:38","detail_orders":[{"id":29,"order_id":37,"order_code":"Order00003","product_id":1,"price":800000,"quantity":1,"total_amount":800000,"created_at":"2017-04-12 17

Laravel 5.2 whereBetween not working

拈花ヽ惹草 提交于 2019-12-25 08:28:50
问题 I am using laravel 5.2 framework but in this WhereBetween not working. I am using price range where price starts form 500 to 4000. When I execute the query get empty records but when I remove WhereBetween() then get all records. Please suggest me how to solved this. $query = Property::query(); $query->select('properties.property_id', 'properties.property_title', 'properties.description', 'properties.latitude', 'properties.longitude', 'properties.city_name', 'properties.state_name'); $query-

Blade conditional statements

核能气质少年 提交于 2019-12-25 08:13:45
问题 I have several models. Each model has a create and edit page. If the model has not been created yet, I need to display its create page. If it has been created, I need to show its edit page. So far I have this which works <div class="panel-group" id="accordion"> @if (is_null($project->projectType)) @include ('projects.partials.projectTypesCreate') @else @include ('projects.partials.projectTypesEdit') @endif @if (is_null($project->projectData)) @include ('projects.partials.projectDataCreate')

Blade conditional statements

我与影子孤独终老i 提交于 2019-12-25 08:11:23
问题 I have several models. Each model has a create and edit page. If the model has not been created yet, I need to display its create page. If it has been created, I need to show its edit page. So far I have this which works <div class="panel-group" id="accordion"> @if (is_null($project->projectType)) @include ('projects.partials.projectTypesCreate') @else @include ('projects.partials.projectTypesEdit') @endif @if (is_null($project->projectData)) @include ('projects.partials.projectDataCreate')

Display pure html code in tinymce laravel

白昼怎懂夜的黑 提交于 2019-12-25 08:10:48
问题 Hi I am using tinmymce in laravel5. I create blogposts where i need to display code snippets. for example i want to display this bit of code snippet <meta http-equiv="X-UA-Compatible" content="IE=edge"> and here is my source code as seen in tinymce: <pre><code><meta http-equiv="X-UA-Compatible" content="IE=edge"></code></pre> And this is how it is saved in my database: <pre><code><meta http-equiv="X-UA-Compatible" content="IE=edge"></code></pre> The problem is when i pull that data to edit in

Laravel : Session data to view

蹲街弑〆低调 提交于 2019-12-25 07:35:32
问题 I have the following code, In which i am checking for error. <div class="alert alert-danger {{ (\Session::has('message') && \Session::get('form', 'login') == 'login') ? '' : 'display-hide' }}"> <button class="close" data-close="alert"></button> <span> {!! \Session::has('message') ? \Session::get('message') : 'Please correct your fields.' !!} </span> </div> On the controller side i have : return redirect() ->back() ->with('message', 'Incorrect email or password.') ->with('form', 'login') -

Laravel - How do I get a named route from a config file?

回眸只為那壹抹淺笑 提交于 2019-12-25 07:27:28
问题 I have a few named routes in the routes.php file which I can build the url to via the global route('routename',[args]) . However how can I do this in a config file? I've tried URL::route('name') , and also route('name') and receive the error: Fatal error: Uncaught ReflectionException: Class log does not exist in /var/www/site/vendor/laravel/framework/src/Illuminate/Container/Container.php:734 回答1: When laravel is bootstraping your application to process the request, the config files are not

Laravel 5: Library class not found

旧时模样 提交于 2019-12-25 07:25:38
问题 I've installed this library from github: https://github.com/robholmes/term-extractor I placed the files under public/term-extractor . I tried creating a route to test the results of the library, but I keep getting the error Class 'TermExtractor' not found . Here is the route: Route::get('/test', function() { require public_path() . '/term-extractor/src/TermExtractor/TermExtractor.php'; $text = 'Inevitably, then, corporations do not restrict themselves merely to the arena of economics. Rather,

Want to fetch data from three tables in laravel 5.2

旧时模样 提交于 2019-12-25 07:20:04
问题 I have a little query in which I need your help, Please have a look below. I want to fetch all the data from the products table with some conditions like city, price, Type, category. I can fetch all the data but I can't fetch the category data from the product model with all other conditions. Below is my tables and Eloquent relations. I am using Laravel 5.2. products ->foreign_key('subcategory_id') subcategories ->foreign_key('category_id') category users: ->foreign_key('product_id') users

laravel guzzlehttp - Server Exception in RequestException.php

你离开我真会死。 提交于 2019-12-25 07:06:40
问题 I am getting ServerException in RequestException.php line 107 when I make POST request to my API. I get following error - Server error: POST http://10.10.1.40:3000/auth/register resulted in a 500 Internal Server Error response: {"statusCode":500,"errorMessage":"[object Object]"} . I tried sending post request from REST Client and it works. Following is the trace in RequestException.php line 107 at RequestException::create(object(Request), object(Response)) in Middleware.php line 65 at