Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

rumm.an

Experience

34,520

23 Best Reply Awards

  • Member Since 4 Months Ago
  • 193 Lessons Completed
  • 0 Favorites

12th December, 2017

rumm.an left a reply on Send Data Via Href • 2 days ago

if its a many to many relationship then, your firm belongs to a number of categories. If so, it depends on you which category_id you want to send in.

10th December, 2017

rumm.an left a reply on Deploy Laravel App And Can Only See Homepage Others Got 404 • 4 days ago

@htooaunghlaing95 Let other's know how you solved your problem

rumm.an left a reply on Average Of GroupBy • 4 days ago

Try this Raw select statement instead of Collection's avg and groupBy:

Product::selectRaw('AVG(sells) average, WEEK(created-at) week')
    ->where('x', '=', 1)
    ->where('y', '=', 1)
    ->groupBy('week');

rumm.an left a reply on Deploy Laravel App And Can Only See Homepage Others Got 404 • 4 days ago

@Yamen He is using Nginx, Nginx doesnt support .htaccess.

@htooaunghlaing95 Is it a Laravel's 404 or NginX one's?

rumm.an left a reply on Problem With Postgresql 'where' Function SQLSTATE[22P02]: Invalid Text Representation: 7 ERROR: Invalid Input Syntax For Integer: • 4 days ago

Seems like you are providing a string in $value. But in where method you are trying to compare id which itself is an integer with the $value which is string. Why don't you test this with some hard-coded integer value that exists in your table just to test.

Jobfieldofstudy::where("id", 2)->delete(); // assuming there exists a record with id=2

8th December, 2017

rumm.an left a reply on How To Query This • 6 days ago

@tykus I think he dont have any crime_date column crimes table. Then, why are you querying by crime_date ?

rumm.an left a reply on Trouble Using Api Method Not Allowed Exception • 6 days ago

make sure you have method="POST"attribute in your form tag.

rumm.an left a reply on Trouble Using Api Method Not Allowed Exception • 6 days ago

If you are hitting the url with your browser then you must be performing a GET request. To perform a POST request you need a client like Postman. There are other methods also like the CLI curl

6th December, 2017

rumm.an left a reply on LR 5.5 Not Work GetRouteKeyName() • 1 week ago

Eloquent's find() method doesn't make use of getRouteKeyName() and it doesnt need to because it is not related to Eloquent, it is related with Route Model Binding. The Eloquent's find() method finds a Model by its primary key which is probably idnot slug in your case. Route Binding means when you give slug in your route it resolves to your related model in your Controllers. But when you call methods like find()on your model, It is not supposed to work this way!

5th December, 2017

rumm.an left a reply on Get UserId With UserName Without Query • 1 week ago

if you only need id that can be achieved with Auth::id().

rumm.an left a reply on LR 5.5 Not Work GetRouteKeyName() • 1 week ago

findorFail() method searches for the primary key. getRouteKeyName() method is just for route model binding. In general you would like to use traditional where() method to find a model with a certain slug. Like this:

Advert::where('slug', 'what-your-slug-is')->first();

Simple enough.

4th December, 2017

rumm.an left a reply on Object Of Class Closure Could Not Be Converted To String • 1 week ago

You dont need to pass closure to doesnHave method. Try this instead:

$queryBuilder = Inquiry::query();

$queryBuilder->doesntHave("booking")
    ->whereHas("customer", function($qq) use ($request) {
            $qq->where("lastname", "LIKE", "%" . $request->input("lastname") . "%");
    })
    ->get();

29th November, 2017

rumm.an left a reply on Laravel Error • 2 weeks ago

firstly, please write proper code blocks.

26th November, 2017

rumm.an left a reply on Laravel - Delete User With Anchor Tag • 2 weeks ago

Anchor tag is used for GET requests, you cannot directly make anchor tag to submit other request types. The one approach you can use is a simple for with one delete button. Or another way is to use JavaScript to disable default action of anchor tag and instead submit a form with some id.

25th November, 2017

rumm.an started a new conversation Npm Run Scripts Not Working After Updating Homestead Vbox 2.1.0 -> 4.0.0 • 2 weeks ago

I am using laravel-mix. npm run dev doesn't work in vagrant environment, neither locally. below is the error:

> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at exports._errnoException (util.js:1020:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
    at onErrorNT (internal/child_process.js:376:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-11-25T13_42_41_057Z-debug.log

I guess, this is possibly due to changed npm version.

23rd November, 2017

rumm.an left a reply on Ajax Post Error • 3 weeks ago

Look at your xhr request in network tab click on your request and click prieview tab that will render the html response so that you can see whats coming in $request

rumm.an left a reply on Add Item To Nested Collection • 3 weeks ago

foreach($imports as $import) {
    $rate = $import->rate;
    $import->specifications->map(function($spec) use ($rate){
        $spec['total'] = $rate * $spec->weight * $spec->price;
    return $spec;
    });
}

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

@nanadjei2 Good job! :like:

rumm.an left a reply on Ajax Post Error • 3 weeks ago

What tool are you using something like Postman or some browser?

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

If you want your pivot table to have automatically maintained created_at and updated_at timestamps, use the withTimestamps method on the relationship definition: See docs

public function tags() {
    return $this->belongsToMany(
        'App\CmsPostCategoryTag', 'cms_post_category_tags', 
        'cms_post_id', 'cms_post_category_id'
    )->withTimestamps();
}

rumm.an left a reply on Pull A BelongsTo Relation In Blade • 3 weeks ago

Give your relations and views. And tell me precisely what do you want to have as output?

rumm.an left a reply on Laravel 5.5 Session::put Not Work • 3 weeks ago

for authentications through ajax you should not use sessions, there are other methods for api authentication like token. You can take a look at API Authentication with Passport

rumm.an left a reply on Ajax Post Error • 3 weeks ago

@zion good point! @david001 make sure you have description in the protected $fillable array in your model, or otherwise, you must have protected $guarded = [], means $guarded array should be empty.

rumm.an left a reply on Ajax Post Error • 3 weeks ago

you should have received an html respose, use your browser's dev tool's network tab and see your request preview there.

rumm.an left a reply on Pull A BelongsTo Relation In Blade • 3 weeks ago

Why dont you keep it very simple, This example might help you In Your Controller method:

$activity = Activity::with('task')->find(1);
return view('some.view', compact('activity'));

in your some/view.blade.php :

<h1> {{ $activity->task->task_title }} </h1>

Maybe this helps.

rumm.an left a reply on Ajax Post Error • 3 weeks ago

I want to see the preview of resonse not you javascript actions. What response did you get from your ajax request when you use dd()

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

$tags = [];
$pivot = ['slug' => $request->slug];
foreach($request->post_category_tags as $tagId) {
    $tags[$tagid] = $data;
}
$post->tags()->sync($tags);

This should work for you!

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

when you sync multiple relations you need to pass an associative array as an first argument. Say, I want to add attach tags with id 1,2,3 along with the pivot data slug as some-slug for each of them:

$data = ['slug' => 'some-slug']
$post->tags()->sync([1 => $data, 2 =>$data, 3=>$data]);

but in your case you are doing wrong way.

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

okay got it!

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

'published_at' => Carbon::parse($date)->format('Y-m-d'),

You dont have a published_at column in your table!

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

$post->tags()->sync($request->post_category_tags, $data); this suggests that you have a column slug in your pivot table.

Are you getting any errors with this code?

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

and what about tags and the pivot table ?

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

I mean how? What behaviour you want? What is your database relationships structure?

rumm.an left a reply on Post Tags Sync With Additional Data Like Slug. • 3 weeks ago

How you want it(slugs) to work?

rumm.an left a reply on Relationship Create Not Working As Expected. • 3 weeks ago

//create a family for user
$family = Family::create([
    // create model
]);
$user->family()->associate($family);
$user->compressionProfile()->create([
    //create model
]);
$user->save();

This looks neat.

rumm.an left a reply on Scope Problem In User Model • 3 weeks ago

you are never return a QueryBuilder Instance so it is considered as random method, Try this:

public function scopeNombre($query, $nombre)
    {
        if ($nombre != "") {
           return  $query->where('nombre', $nombre);
        }
        return $query; 
    }

rumm.an left a reply on Laravel 5.5 Session::put Not Work • 3 weeks ago

try to put into session and get from session in the same request. Something like:

Route::get('test', function(){
    \Session::put('test', 'Yayeee works');
    return \Session::get('test');
})

Tell us if that works?

rumm.an left a reply on Laravel 5.5 Session::put Not Work • 3 weeks ago

I create a following route in web.php to testing and var_dump(Session::get('session_test')) return null;

If you are using ajax this is not intended to work.

rumm.an left a reply on Ajax Post Error • 3 weeks ago

add dd($request->description) in your controller and tell me your output.

rumm.an left a reply on Check Relationship Has A Relationship • 3 weeks ago

Which methods are in which model? no mention!

22nd November, 2017

rumm.an left a reply on How To Return An Object In Json With Laravel 5.5 • 3 weeks ago

Try this return statement:

return collect([
    'response' => 'success',
    'comments' => $comments,
]);

rumm.an left a reply on Retrieve Great Grandchild • 3 weeks ago

According to your schema, this should be like:

Measurement::with([ 'partBasePart.material'])->where('id', 315);

rumm.an left a reply on Best Hosting Site For Laravel? • 3 weeks ago

DigitalOcean with Forge is great power.

rumm.an left a reply on Laravel: Select From Multiple Tables (preferently With ORM) • 3 weeks ago

with Eloquent ORM :

return table1::with(['table2', 'table2.table3']);

Simple. Right?

rumm.an left a reply on ViewComponents Error In Laravel 5.5 • 3 weeks ago

It is the Grid Framework in laravel 5.5 https://github.com/view-components/grids#documentation

I didn't knew about that.

rumm.an left a reply on To Customise Routing • 3 weeks ago

I dont know what websites you want to combine but , If I had websites like forum, blog and a main website. Suppose I have, forum on example-forum.com blog on example-blog.com main on example.com

I'd like to bring them in so that, forum is forum.example.com blog is blog.example.com main is example.com

You must have already handled the language resolver in each of your websites individually, so all you have to do is: bring the routes of your wesites in a single application under subdomain groups. That should work.

OR

You should explain, what you have tried already and what problems you are facing. Give us some code and errors.

rumm.an left a reply on ViewComponents Error In Laravel 5.5 • 3 weeks ago

I dont think, there is something like ViewComponents in Laravel 5.5. You can use autoloader to load your class.

rumm.an left a reply on To Customise Routing • 3 weeks ago

You can use subdomain routing for each of your websites.

rumm.an left a reply on Bootstrap In Laravel 5.5 • 3 weeks ago

Yes, it comes with bootstrap presets, you can scaffold using php artisan preset bootstrap command. After that, just run npm install from your project root and it will install the bootstrap. When you transfer your files to Linux Production Server, you will need to run npm install.

21st November, 2017

rumm.an left a reply on What Permissions/Roles Package To Use? • 3 weeks ago

Yea but still I see, its a good option.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.